Closed AaronKutch closed 4 years ago
Merging #51 into master will decrease coverage by
0.34%
. The diff coverage is34.82%
.
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
- Coverage 76.12% 75.77% -0.35%
==========================================
Files 22 21 -1
Lines 5340 5288 -52
==========================================
- Hits 4065 4007 -58
- Misses 1275 1281 +6
Impacted Files | Coverage Δ | |
---|---|---|
src/uint.rs | 0% <ø> (ø) |
:arrow_up: |
src/bitwidth.rs | 89.06% <ø> (-9.51%) |
:arrow_down: |
src/storage.rs | 100% <ø> (ø) |
:arrow_up: |
src/digit_seq.rs | 77.77% <ø> (ø) |
:arrow_up: |
src/apint/casting.rs | 77.72% <ø> (+1.33%) |
:arrow_up: |
src/apint/serde_impl.rs | 78.94% <ø> (ø) |
:arrow_up: |
src/bitpos.rs | 100% <ø> (ø) |
:arrow_up: |
src/apint/shift.rs | 100% <ø> (ø) |
:arrow_up: |
src/int.rs | 0% <ø> (ø) |
:arrow_up: |
src/radix.rs | 88.88% <ø> (ø) |
:arrow_up: |
... and 17 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 10aa554...494faba. Read the comment docs.
I compared the
.rustfmt.toml
I made with yours and I am suggesting a few changes. I placed the keys in alphabetical order. I think usingimports_layout = "HorizontalVertical"
is better since it uses horizontal layout for 2-4 imports (typically) and a vertical layout for longer than that. I think keeping comment width at 80 is a good idea, however I would prefer the defaultmax_width = 100
. I also used a few nightly keys to improve comment formatting.
Can you please precisely list what changes you made exactly?
I was even thinking about setting max_width
to 80
but that would have been too disruptive for now. In my opinion long lines are just another indicator of code smell. Also I do not want an ultra-flat screen for code review or for looking at diffs.
I also find it easier to look at horizontal lists to grab an overview that's why I chose imports_layout = "Vertical"
but I might go with you. Let me think about it.
I decided to go with your max_width = 90
. The differences between my .rustfmt.toml
and the current one is:
My comments on your proposals below.
* imports_layout = "HorizontalVertical"
I will think about this.
I might prefer this over Vertical
if we can manage to reduce the line noise to line widths of at most 40
columns or so. I really hate to read too many comma-separated names in a single line.
* error_on_line_overflow = true (I manually formatted in some places to make this work) * error_on_unformatted = true
Maybe we want this for CI instead since I do not want to pollute too many warnings into errors as I have made the experience of this causing troubles with prototyping new code.
* report_fixme = "Never" (I always look at the todo's manually) * report_todo = "Never"
My experience in the past with these flags were very positive. But also maybe we want to provide those as errors in CI. I'll think about it.
* newline_style = "Unix" # changed, prevents problems when a file is created on Windows
If this really fixes problem I wonder why it isn't the default. Can you elaborate or link to an issue?
* struct_lit_single_line = true
I like this but it is unstable (as some other already used flags) and since apint
is also for the stable
channel we have to be careful what configurations of rustfmt
we actually are able to use.
* format_macro_bodies = true * format_code_in_doc_comments = true
I have had bad experience with these in the past and won't accept them therefore.
I am using newline_style = "Unix"
to enforce LF line endings throughout the codebase. For some reason (probably due to git or one of my editors trying to change LF back to CRLF), I always have a problem with the files being a mix of CRLF and LF. I just checked manually, and some files are still CRLF for some reason. I don't know if it is git's problem or some bug with rustfmt. I just force pushed a commit to fix it.
Maybe we want this for CI instead since I do not want to pollute too many warnings into errors as I have made the experience of this causing troubles with prototyping new code.
I only found about five places in the entire codebase that rustfmt was unable to format, mainly due to comments in the middle of method chains.
My experience in the past with these flags were very positive. But also maybe we want to provide those as errors in CI. I'll think about it.
These should be put in CI.
I like this but it is unstable (as some other already used flags) and since apint is also for the stable channel we have to be careful what configurations of rustfmt we actually are able to use.
rustfmt
is purely a developer side thing, so I don't think there is any issues with the unstable flags.
I have had bad experience with these in the past and won't accept them therefore.
I have experienced only positive things, except for the documentation for from_str_radix
in serialization.rs
, where I had to change the comments from being inline to being in front of what they are commenting on
Github has a feature to view all non-whitespace changes
I fixed the merge conflicts. The Fix rustfmt errors
contains all the manual reformatting.
There are warnings after the rebase that appear to be from your commits. I will fix them sometime next week.
Are you still not satisfied with my changes?
Are you still not satisfied with my changes?
Have to give it another look. Didn't look into this for a while. But what I can quickly say is that I definitely find
use crate::{
apint::ApInt,
bitwidth::BitWidth,
digit::Digit,
};
... more readable than ...
use crate::{apint::ApInt, bitwidth::BitWidth, digit::Digit};
Should I squash the last three commits?
wait, I just realized I need to rebase on top of the into_iter
change, let me fix it
That should be it, except I am getting the warning
warning: unused import: `libm::F64Ext`
--> src\apint\serialization.rs:277:13
|
277 | use libm::F64Ext as _
I presume this is from the commit that supports no_std
That should be it, except I am getting the warning
warning: unused import: `libm::F64Ext` --> src\apint\serialization.rs:277:13 | 277 | use libm::F64Ext as _
I presume this is from the commit that supports no_std
Then maybe we simply need a cfg no_std
for the import.
I fixed the warning for most cases and a compilation error for serde_support with no_std. For some bizarre reason, when I run with cargo check --features=serde_support,libm_0 --no-default-features
, it gives an unused warning as if the F64Ext
isn't needed any more. I cannot see anywhere where adding serde_support
pulls in a way for the log2
function to not need the F64Ext
in no_std. It doesn't do the same thing with rand_support
.
I am almost done with getting my division algorithms into compiler-builtins. When are you going to merge this?
I am almost done with getting my division algorithms into compiler-builtins. When are you going to merge this?
Sorry, forgot about this PR. Can you send me a link to your compiler-builtin PR? I will review this again and eventually merge this today or tomorrow - I will keep the TAB open so that I don't forget again. ;)
https://github.com/rust-lang/compiler-builtins/pull/332 This will greatly improve u128 division and divisions for 32 bit platforms
All I want for Christmas is a rapid PR review cycle
All I want for Christmas is a rapid PR review cycle
You can help this rapid PR review cycle by chunking your commits in a way that makes them easy to review. For example in this PR the single most important file is obviously .rustfmt.toml
. However, you made two changes to it: Changing some options and changing ordering: The first change is severe, the other change is trivial to review. However, since you merged both changes into a single commit it made it hard to extract the severe parts out of the many trivial ones. So by simply phasing out those 2 changes into two separate commits you wouldn't force a reviewer to go through every single line, check what changed and if so check the Rust docs but would simply pre-filter the important parts out.
However, since you merged both changes into a single commit it made it hard to extract the severe parts out of the many trivial ones.
What happened here was I completely replaced the existing rustfmt.toml with my original rustfmt.toml I had made for the reorganization PR that never made it. I should have put yours in alphabetical order in one commit, and then replaced it with another commit.
I had a really bad sickness recently and it sapped all my energy and is distorting my judgement. I will redo the commits a third time to fix your problems
I split up the formatting itself to show you what the
format_code_in_doc_comments = true # changed
format_macro_bodies = true # changed
format_macro_matchers = true # changed
format_strings = true # changed
part does so you can see it is useful
cargo fmt
returns nothing except for TODO
warnings after the last commit.
I had a really bad sickness recently and it sapped all my energy and is distorting my judgement. I will redo the commits a third time to fix your problems
It is fine. I have already went through the whole changes. I will give it another look tomorrow (very tired rn) and probably approve and merge then. Thank you again for all your work on this crate!
I compared the
.rustfmt.toml
I made with yours and I am suggesting a few changes. I placed the keys in alphabetical order. I think usingimports_layout = "HorizontalVertical"
is better since it uses horizontal layout for 2-4 imports (typically) and a vertical layout for longer than that. I think keeping comment width at 80 is a good idea, however I would prefer the defaultmax_width = 100
. I also used a few nightly keys to improve comment formatting.