| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
| |
This commit adds #[allow(clippy::string_slice)] to all functions in the
code where string slices are used, alongside a TODO comment.
We do this add the function header to have it consistent, as things like
expression based allow's are still experimental.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
| |
Co-authored-by: Ian Jackson
|
| |
|
|
|
|
|
|
| |
This commit modifies the dotline check to prevent generating lines that
consist of a single dot followed by an arbitrary amount of whitespace,
such as `.`, `. `, `. \t `, but not `. \t foo`.
It also adjusts the tests appropriately.
|
| | |
|
| |
|
|
|
|
|
| |
As pointed out by Diziet, our implementation does not reject dotlines
properly, due to our use of `trim_end()`. This commit fixes this, by
just checking for `line == ".\n"`. This is fine because we ensure Unix
line endings now anyways.
|
| |
|
|
|
|
|
|
|
|
| |
This commit changes the consdiff generation to enforce Unix line endings
and reject all other ones, including Windows line endings as well as no
line endings. In other words, it checks for `\n` while forbidding
`\r\n`.
It also renames the relevant error variant to reflect this change
better.
|
| |
|
|
| |
This is done to only get the first directory-signature.
|
| |
|
|
|
|
| |
This commit refactors the result composition by simply looping over
every line and checking whether it ends with a newline AND does not
consist of a single dot.
|
| |
|
|
|
|
| |
This commit changes the error variants that contain a line number to a
named variant with a field `lno: usize` to make it semantically clear,
that it is a line number.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Now that we no longer use .lines(), everything should work fine with
CRLF -- and it does. :-)
|
| |
|
|
|
|
|
|
|
| |
This commit removes all manual line splits in the consdiff generation.
Instead, it now simply uses the primitives offered by imara-diff to
access the lines in the input itself.
Meanwhile, it also adds a check for missing newlines/assertions that all
lines are actually terminated by \n.
|
| |
|
|
|
| |
This commit replaces the use of lines with byte offsets for cutting of
the signatures.
|
| | |
|
| |
|
|
|
| |
This commit adds a compile time assertion that a u32 can always be
safely casted into a usize.
|
| |
|
|
|
| |
This commit adds a check that prevents gen_cons_diff from computing a
diff with a single dot line.
|
| |
|
|
|
|
| |
This commit refactors gen_ed_diff to have less code duplication by not
matching upon the hunk type once but by splitting it into two different
matches for the header and the body.
|
| |
|
|
|
|
| |
Mark a failed apply from a consensus diff we generate as a bug as this
should not happen. We must obviously always accept the consensus diffs
we produce.
|
| |
|
|
|
| |
This commit replaces repeated `result += &format!(...)` cruft with
`write!` calls and multi-line strings.
|
| |
|
|
|
| |
This commit moves "directory-signature" and "directory-signature " into
semantically meaningful constants.
|
| |
|
|
|
|
|
| |
This commit replaces the names crate with a simple hardcoded wordlist of
length 20, obtained from my systems wordlist.
Reason for that being that names triggers a cargo-audit failure.
|
| |
|
|
|
|
|
|
| |
This commit implements support for the consensus diff generation.
Unlike CTor, it does not use its own custom algorithm but rather uses an
implementation of Myers' algorithm from the `imara-diff` crate, which is
pretty performant and comparable to size and run time to CTor, while
being much simpler in the interfacing code.
|
| |
|
|
|
|
|
|
|
| |
`clippy::collapsible_if` started triggering after bumping the MSRV to
1.88.
Since this triggers from a lot of places, and since there even are a
couple of instances where we explicitly allow `clippy::collapsible_ifs`,
I've opened #2342 for deciding what to do about it.
|
| |
|
|
| |
This adds the lint to all our crates.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
| |
This feature has been removed from nightly, in favor of doc_cfg.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Run cargo fix --edition
2. Selectively revert the "if let"->"match" changes.
These changes are meant to protect us from the lifetime changes
for "if let" bindings in Rust 2024.
But we're not actually relying on the old lifetime rules
anywhere, and the match syntax here is quite ugly.
3. Automatically revert `$pat:expr_2021` to `$pat:expr`.
(We don't actually want to restrict the expression syntax
that our macros accept).
Done with
`git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'`
4. Run cargo fmt.
|
| |
|
|
| |
See #2060.
|
| |
|
|
|
|
|
|
|
| |
- After spending quite a while trying to figure out why the tests kept failing
after making the change, I eventually stumbled upon the netdoc syntax
specification, which helpfully informs me that newlines MUST be ignored and
discarded. Switching to using [`str::split_inclusive`] would either require
extra lines to workaround and recreate the current expected behavior or changing
the spec and correcting the tests to align with the new expected behavior.
|
| |
|
|
|
|
|
|
| |
- Part of a series of commits aimed at replacing all MSRV-related TODOs with a
standardized format, which should be easier to find when the MSRV is bumped. For
this one in particular, we actually do already meet the MSRV specified, but I
want to check on the implementation details to see if this is still desired,
since the TODO is 4 years old.
|
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |
|
|
|
|
|
|
| |
In 1.83, this warning triggers on many of our crates.
We're thinking of fixing them all, but for now,
we're going to disable the warning.
This is part of #1765.
|
| |
|
|
|
| |
This now generates an error (per #1395), and everything we used it for
is also available as a feature.
|
| |
|
|
| |
This commit is automatically generated.
|
| |
|
|
|
|
| |
The old code produced a warning from clippy nightly; we may as well
update to use the new associated consts. (They've been there since
Rust 1.4x.)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Closes #950.
|
| | |
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|