Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Feb 27, 2024

The lint check has many issues:

  • It uses COMMIT_RANGE, which is brittle code, apparently making it harder to run the CI locally, or self-hosted. See Fix issues with CI on forks #29274 (comment)
  • The result depends on COMMIT_RANGE, or the number of commits passed to the script, which can cause false negatives or false positives.
  • It is based on the diff output, parsing it, and printing it again, which is brittle as well.
  • The output does not include line number, making it harder to act on a lint error.

Fix all issues by removing the script and replacing it with a simple call to git grep -I --line-number ....

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 27, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK TheCharlatan
Concept ACK Empact

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29479 (test: Refactor subtree exclusion in lint tests by BrandonOdiwuor)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@Sjors
Copy link
Member

Sjors commented Feb 27, 2024

Does this PR allow dropping COMMIT_RANGE from ci/lint/06_script.sh?

@maflcko
Copy link
Member Author

maflcko commented Feb 27, 2024

I think it should be dropped, but that can be done in a follow-up, unrelated to the bugfixes here.

@Empact
Copy link
Contributor

Empact commented Feb 27, 2024

Concept ACK

@maflcko maflcko force-pushed the 2402-lint-fix-ws- branch from fa68024 to fa67aad Compare March 11, 2024 11:33
@maflcko maflcko force-pushed the 2402-lint-fix-ws- branch from fa67aad to fa57294 Compare March 12, 2024 12:38
fn lint_tabs_whitespace() -> LintResult {
let tabs = git()
.args(["grep", "-I", "--line-number", "--perl-regexp", "^\\t", "--"])
.args(["*.cpp", "*.h", "*.md", "*.py", "*.sh"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is pretty limited. Would adding .rs to it make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it can be added. I tried to keep everything as-is, except for the bugfixes. I may add it, if I have to re-touch.

Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, ACK fa57294

@DrahtBot DrahtBot requested a review from Empact March 13, 2024 14:25
Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-ACK 5555395

@fanquake fanquake merged commit 015ac13 into bitcoin:master Mar 15, 2024
@maflcko maflcko deleted the 2402-lint-fix-ws- branch March 15, 2024 13:36
@bitcoin bitcoin locked and limited conversation to collaborators Mar 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants