feat: warn when exclusive '..' syntax is used in accept ranges#2169
Closed
mre wants to merge 2 commits into
Closed
feat: warn when exclusive '..' syntax is used in accept ranges#2169mre wants to merge 2 commits into
mre wants to merge 2 commits into
Conversation
This was referenced Apr 25, 2026
The exclusive '..' range syntax follows Rust semantics and excludes the upper bound, which is a common source of confusion (e.g. '301..302' only accepts 301, not 302). Emit a warning to help users notice the mismatch.
f821a12 to
0fe385d
Compare
Member
|
Hmm actually this is not getting logged :/ The reason being that the logger is initialised only after the options are parsed. let mut opts = LycheeOptions::parse();
init_logging(&opts.config.verbose(), &opts.config.mode());This would be another reason to add user-hints to lychee lib. I'm not sure how easy it is |
Member
Author
|
Wellll.... I should have added a cli test for that. Nice catch. |
Member
|
I've now cherry picked it into #2021. The user hints are a nice workaround for this issue. It's nice that these two PRs coincided. I think other workaround wouldn't be so nice. We would have to initialise the logger with some dummy verbosity which would be quite a hack. I'm closing this in favour of #2021. |
Merged
Member
Author
|
Yes, makes a lot of sense. Than for picking that up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2178.
The exclusive
..range syntax follows Rust semantics and excludes the upper bound, which is a common source of confusion (e.g.301..302only accepts 301). Emit a warning to make this visible.This could be promoted to an error or downgraded to a hint once #2021 lands.