Commit graph

6 commits

Author SHA1 Message Date
Matt Corallo
930f5fbf9a Only attempt to rustfmt files checked into git
This avoids `rustfmt` failing on Rust files generated by dependent
crates in `target`, eg

```
+ rustfmt --edition 2021 --check ./target/debug/build/thiserror-8230374e07b5c05a/out/probe.rs
Diff in /home/matt/rust-lightning-3/target/debug/build/thiserror-8230374e07b5c05a/out/probe.rs at line 1:

-    #![feature(provide_any)]
+#![feature(provide_any)]

-    use std::any::{Demand, Provider};
+use std::any::{Demand, Provider};

-    fn _f<'a, P: Provider>(p: &'a P, demand: &mut Demand<'a>) {
-        p.provide(demand);
-    }
+fn _f<'a, P: Provider>(p: &'a P, demand: &mut Demand<'a>) {
+	p.provide(demand);
+}
```
2024-09-18 18:04:54 +00:00
Elias Rohrer
e5fea78502
Fix misc shellcheck complaints 2024-08-13 08:50:30 +02:00
Matt Corallo
4c650b9830 Force locale in rustfmt shell scripts that rely on sort order 2024-08-06 15:13:59 +00:00
Elias Rohrer
43b41868bb
Pass our edition to rustfmt
.. as it otherwise doesn't seem to pick up the right one when checkin
integration tests.
2024-06-07 16:55:11 +02:00
Matt Corallo
6ab91cb43f Drop the rustup-specific calling in ci/rustfmt.sh
The +rustversion call semantics are specific to rustup and do not
work with standard rust toolchains. However, because rustfmt
formatting differs slightly between stable and our 1.63 target, we
need to keep the +1.63.0 for rustup users.

Thus, here, we check for the presence of a `rustup` command and
pass the "+1.63.0" argument if we find one.
2024-04-22 13:05:53 +00:00
Elias Rohrer
d5344dc178
Add rustfmt to CI, ignore all files
We add the previously discussed `rustfmt.toml` and enforce it in CI for
any files that are not contained in an exclusion list.

To start, we add all current Rust files to this exclusion list. This
means that formatter rules will be enforced for any newly introduced
files, and we'll then start going through the codebase file-by-file,
removing them from the list as we go.
2024-02-14 09:08:33 +01:00