-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo +nightly fmt #1017
cargo +nightly fmt #1017
Conversation
Personally I would not add |
Not possible, since Note that the formatting changes done here are more or less the same as formatting without |
@nathanielsimard would depending on nightly affect the release to crates.io? |
@AlexErrant Since most of the development is done on stable, I feel like it's better to stick with Rust fmt stable instead of nightly. Once of the main reason to use a formatter is to eliminate conflicts generated by using different formatters by different people. However, I'm not against accepting a pull request that reformats the code using fmt nightly and then re-reformats it using the stable version. This could improve the formatting without creating conflicts with the stable formatter—just improving the code style where the stable branch falls short. |
Done! |
burn-autodiff/src/ops/tensor.rs
Outdated
@@ -1085,7 +1085,9 @@ impl<B: Backend> TensorOps<Self> for Autodiff<B> { | |||
phantom: PhantomData<B>, | |||
} | |||
|
|||
impl<B: Backend, const D: usize> Backward<B::FullPrecisionBackend, D, 1> for ToFullPrecision<B> { | |||
#[rustfmt::skip] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid skipping fmt
burn-autodiff/src/ops/tensor.rs
Outdated
@@ -1113,7 +1115,9 @@ impl<B: Backend> TensorOps<Self> for Autodiff<B> { | |||
phantom: PhantomData<B>, | |||
} | |||
|
|||
impl<B: Backend, const D: usize> Backward<B, D, 1> for FromFullPrecision<B::FullPrecisionBackend> { | |||
#[rustfmt::skip] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid skipping fmt
xtask/src/runchecks.rs
Outdated
if std::env::var("DISABLE_WGPU").is_err() { | ||
cargo_test(["-p", "burn-core", "--features", "test-wgpu"].into()); | ||
} | ||
cargo_test(["-p", "burn-core", "--features", "test-wgpu"].into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should remove that if
xtask/src/runchecks.rs
Outdated
} else { | ||
cargo_build(["--workspace", "--exclude=xtask"].into()); | ||
} | ||
cargo_build(["--workspace", "--exclude=xtask"].into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1017 +/- ##
==========================================
- Coverage 85.57% 85.54% -0.03%
==========================================
Files 508 508
Lines 53912 53993 +81
==========================================
+ Hits 46133 46191 +58
- Misses 7779 7802 +23 ☔ View full report in Codecov by Sentry. |
Whoops I went a little too delete-happy in |
Pull Request Template
Checklist
run-checks all
script has been executed.nnnnope still broken on my box
Related Issues/PRs
Instigating comment.
Changes
Format silently breaks on lines longer than the default, 100. I enable two nightly features,
error_on_line_overflow
andformat_strings
. Despite being nightly, we can runcargo +nightly fmt
while remaining on the stable toolchain.format_strings
is useful for breaking up long lines as mentioned here.error_on_line_overflow
is useful for making long lines explicitly fail. You may still have to manually format and annotate with#[rustfmt::skip]
, otherwise you get errors like:Grep this PR for
#[rustfmt::skip]
for example usage.Interestingly setting
max_width = 200
, formatting, then settingmax_width = 100
and formatting seemed to shake loose some changes.Testing
I made some changes to
runchecks
, lessee what CI thinks.