Skip to content
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

chore(ci): remove clippy.sh #1917

Merged
merged 1 commit into from
Nov 13, 2024
Merged

chore(ci): remove clippy.sh #1917

merged 1 commit into from
Nov 13, 2024

Conversation

giladchase
Copy link
Contributor

  • Only one source of truth for lints, main Cargo.toml, making clippy.sh unnecessary.
  • Warnings no longer denied, only in the CI. To preserve existing behaviors users can add -Dwarnings to local RUSTFLAGS.

We still need to enforce in workspace tests that all crates inherit workspace lints.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

See this example PR that rejects a commit that violated nonstandard-style, which is now just a warning locally, but generates an error in the CI.

Note: unused-imports, the main suspect, is already warning by default.

Reviewable status: 0 of 3 files reviewed, all discussions resolved


scripts/run_tests.py line 49 at r1 (raw file):

            # Don't remove, or warnings will merge.
            # TODO: add this to package args instead of here, it is a rustc flag, not a clippy flag.
            clippy_args += ["--", "-Dwarnings"]

This is suboptimal, would have preferred to add this to package_args but that one's already used for options, whereas -Dwarnings as shown below is an operand.

Technically this implies adding a package_operands array but I didn't want to overengineer this task unprompted.

Code quote:

            # TODO: add this to package args instead of here, it is a rustc flag, not a clippy flag.
            clippy_args += ["--", "-Dwarnings"]

Copy link

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [29.536 ms 29.632 ms 29.733 ms]
change: [-2.2675% -1.8785% -1.4904%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low mild
1 (1.00%) high severe

Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.50%. Comparing base (e3165c4) to head (2e7756a).
Report is 344 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1917       +/-   ##
===========================================
+ Coverage   40.10%   76.50%   +36.39%     
===========================================
  Files          26      373      +347     
  Lines        1895    39965    +38070     
  Branches     1895    39965    +38070     
===========================================
+ Hits          760    30575    +29815     
- Misses       1100     7114     +6014     
- Partials       35     2276     +2241     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @giladchase)


scripts/run_tests.py line 49 at r1 (raw file):

Previously, giladchase wrote…

This is suboptimal, would have preferred to add this to package_args but that one's already used for options, whereas -Dwarnings as shown below is an operand.

Technically this implies adding a package_operands array but I didn't want to overengineer this task unprompted.

can you explain? (maybe offline)


Cargo.toml line 259 at r1 (raw file):

# See [here](https://github.com/taiki-e/cargo-llvm-cov/issues/370) for a discussion on why this is
# needed (from rust 1.80).
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }

please add instruction (here is a good place?)

Suggestion:

# To deny warnings during local development: BLA BLA

[workspace.lints.rust]
future-incompatible = "warn"
nonstandard-style = "warn"
rust-2018-idioms = "warn"
# See [here](https://github.com/taiki-e/cargo-llvm-cov/issues/370) for a discussion on why this is
# needed (from rust 1.80).
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }

Copy link

Artifacts upload triggered. View details here

scripts/run_tests.py Outdated Show resolved Hide resolved
Copy link

Benchmark movements:
tree_computation_flow performance regressed!
tree_computation_flow time: [35.393 ms 35.853 ms 36.394 ms]
change: [+1.0161% +2.3708% +3.7222%] (p = 0.00 < 0.05)
Performance has regressed.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) high mild
7 (7.00%) high severe

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware)


Cargo.toml line 259 at r1 (raw file):

Previously, dorimedini-starkware wrote…

please add instruction (here is a good place?)

Done.


scripts/run_tests.py line 49 at r1 (raw file):

Previously, dorimedini-starkware wrote…

can you explain? (maybe offline)

Fixed, a bit repetitive, can it be better?

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @graphite-app[bot])

scripts/run_tests.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @graphite-app[bot])

scripts/run_tests.py Outdated Show resolved Hide resolved
Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Dismissed @graphite-app[bot] from a discussion.
Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @graphite-app[bot])

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

scripts/run_tests.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, 1 of 1 files at r3, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @giladchase)


scripts/run_tests.py line 49 at r1 (raw file):

Previously, giladchase wrote…

Fixed, a bit repetitive, can it be better?

make the if-else set the base command, then add the operand args outside the if-else blocks?

scripts/run_tests.py Outdated Show resolved Hide resolved
Copy link

Artifacts upload triggered. View details here

Cargo.toml Show resolved Hide resolved
Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Dismissed @graphite-app[bot] from a discussion.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


scripts/run_tests.py line 49 at r1 (raw file):

Previously, dorimedini-starkware wrote…

make the if-else set the base command, then add the operand args outside the if-else blocks?

Not sure that would work, inner branches might want to add args/operands, and you have to add them args first, operands later...
Maybe I misunderstand what you mean, can you give a rough psuedo?

scripts/run_tests.py Outdated Show resolved Hide resolved
scripts/run_tests.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @giladchase)


scripts/run_tests.py line 49 at r1 (raw file):

Previously, giladchase wrote…

Not sure that would work, inner branches might want to add args/operands, and you have to add them args first, operands later...
Maybe I misunderstand what you mean, can you give a rough psuedo?

ok now that review-bot made the RUSTFMT case a special case, my way no longer works anyway :P

@giladchase
Copy link
Contributor Author

It's messier than i thought, even though it's a rustc flag, rustfmt and doc don't respect it.
Trying a different tactic.

@giladchase
Copy link
Contributor Author

reopening

@giladchase giladchase reopened this Nov 12, 2024
Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r9, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @giladchase)


a discussion (no related file):
Q: what about other CI workflows?
example: blockifier_ci builds the blockifier with the native feature; do we need to inject this -D everywhere?


.github/workflows/main.yml line 21 at r9 (raw file):

env:
  CI: 1
  RUSTFLAGS: "-D warnings"

oooh... much better

Code quote:

RUSTFLAGS: "-D warnings"

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @graphite-app[bot])


a discussion (no related file):

Previously, dorimedini-starkware wrote…

Q: what about other CI workflows?
example: blockifier_ci builds the blockifier with the native feature; do we need to inject this -D everywhere?

Don't need really, it's just easier and less error-prone to have this in place rather than in multiple places.
It is unlikely to cause anyone any issues, I saw other popular crates using this pattern in ci.yml.
Moved it closer to callsites.


scripts/run_tests.py line 49 at r1 (raw file):

Previously, dorimedini-starkware wrote…

ok now that review-bot made the RUSTFMT case a special case, my way no longer works anyway :P

Ya rustfmt/doc can't handle this operand, which is weird cause they can handle it through RUSTFLAGS alright 🤷

Cargo.toml Show resolved Hide resolved
Copy link

Artifacts upload triggered. View details here

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r10, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @graphite-app[bot])

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @graphite-app[bot])

- Only one source of truth for lints, main Cargo.toml, making clippy.sh
  unnecessary.
- Warnings no longer denied, only in the CI. To preserve existing
  behaviors users can add `-Dwarnings` to local RUSTFLAGS.

We still need to enforce in workspace tests that all crates inherit
workspace lints.
Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Dismissed @graphite-app[bot] from a discussion.
Reviewable status: 2 of 4 files reviewed, all discussions resolved (waiting on @dorimedini-starkware)

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 4 files at r9, 1 of 1 files at r10, 2 of 2 files at r11, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

@giladchase giladchase merged commit ac64b5b into main Nov 13, 2024
21 checks passed
@giladchase giladchase deleted the gilad/remove-clippy-sh branch November 13, 2024 06:36
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants