Skip to content

Conversation

mcbarton
Copy link
Collaborator

@mcbarton mcbarton commented Apr 8, 2025

This PR fixes all the issues which can be automatically fixed, which are raised by running the ruff tool over the repo. The eventual goal of several PRs would be to have cppyy raise no issues when the ruff linter is used, and have a workflow which checks contributors code.

@mcbarton mcbarton marked this pull request as draft April 8, 2025 15:36
@vgvassilev
Copy link

Can you propose that upstream first?

Copy link
Collaborator

@Vipul-Cariappa Vipul-Cariappa left a comment

Choose a reason for hiding this comment

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

I believe this should be part of the CI checks. Like the clang-tidy and clang-format CIs we use.

@vgvassilev
Copy link

I believe this should be part of the CI checks. Like the clang-tidy and clang-format CIs we use.

I agree. Maybe we should start from idd.

@mcbarton
Copy link
Collaborator Author

mcbarton commented Apr 9, 2025

I believe this should be part of the CI checks. Like the clang-tidy and clang-format CIs we use.

That is part of the plan, that is why I put it in the PR description, buts it won't be able to come as part this PR. Currently the below is what I get if I run ruff over cppyy, and this PR tried to get ruff to fix the ones it believes it can automatically fix. Although it still builds, as you can see the ci jobs now fail for cppyy which I need to look into. Adding a ruff workflow will involve multiple PRs fixing a large list of issues manually. Trying to do it all in one PR would be way too disruptive, and much harder for you to review.

ruff check --statistics .
204	E702	[ ] multiple-statements-on-one-line-semicolon
181	F401	[ ] unused-import
126	E721	[ ] type-comparison
102	E401	[*] multiple-imports-on-one-line
 62	E712	[ ] true-false-comparison
 38	E701	[ ] multiple-statements-on-one-line-colon
 38	F405	[ ] undefined-local-with-import-star-usage
 31	F841	[ ] unused-variable
 24	E703	[*] useless-semicolon
 21	E713	[*] not-in-test
 21	F821	[ ] undefined-name
 19	E741	[ ] ambiguous-variable-name
 16	E402	[ ] module-import-not-at-top-of-file
 11	F811	[ ] redefined-while-unused
  8	E711	[ ] none-comparison
  8	E714	[*] not-is-test
  7	E722	[ ] bare-except
  5	F822	[ ] undefined-export
  3	F403	[ ] undefined-local-with-import-star
  2	F722	[ ] forward-annotation-syntax-error
  1	E742	[ ] ambiguous-class-name
Found 928 errors.
[*] 333 fixable with the `--fix` option (100 hidden fixes can be enabled with the `--unsafe-fixes` option).

@mcbarton
Copy link
Collaborator Author

mcbarton commented Apr 9, 2025

I believe this should be part of the CI checks. Like the clang-tidy and clang-format CIs we use.

I agree. Maybe we should start from idd.

I had started to look into this yesterday. Getting a passing ruff workflow for idd looks a lot easier. I just haven't put in a PR yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants