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

first sketch of cython-lint workflow #204

Merged
merged 5 commits into from
Aug 30, 2024

Conversation

fchapoton
Copy link
Contributor

let's try to add a cython-lint checker in a workflow

@oscarbenjamin
Copy link
Collaborator

It might be that the workflow doesn't run until it is actually merged or something.

@fchapoton
Copy link
Contributor Author

yes, could be. I have to add many ignored codes too

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure it matters but minimum version is 3.10 now.

Does the lint check depend on the Python version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. I think the cython-lint does not, but maybe ruff checks will depend if they are added later. So let us keep a set of python versions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now the lint workflow is running ; probably it will fail, let's see

@fchapoton
Copy link
Contributor Author

now with large-scale removal of unused variables and imports. The former in particular may benefit from a careful check.


- name: cython-lint
run: |
cython-lint --ignore=E114,E117,E127,E128,E129,E202,E221,E222,E231,E261,E262,E265,E302,E303,E306,E501,E701,E703,E711,E722,E731,E741,E743,W291,W293,W391,W605 src/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it still need all of these?

I think it is fine if there are lots of ignore code for now because they can be disabled incrementally.

It would be better if the ignore codes are in pyproject.toml though so that it works the same when running locally as in CI.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or maybe it is better to leave these here for now until most errors are fixed since we don't intend to keep all of these ignores codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I only added codes that I have seen failing.

I have moved the config to pyproject.toml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although my branch here is not based on my recent fix-ups, that in particular fix W605.

@oscarbenjamin
Copy link
Collaborator

I've been through all the diff and it looks good although I'll let the CI finish.

@fchapoton
Copy link
Contributor Author

fchapoton commented Aug 30, 2024

I have rebased the branch on master, squashed the first few commits and shortened the ignore list

@oscarbenjamin
Copy link
Collaborator

Okay, looks good to me. I'll wait for CI to finish.

@oscarbenjamin
Copy link
Collaborator

I'm going to add a development workflow page to the docs and I'll mention how to run cython-lint there. We should probably arrange it so that you can do e.g.

$ spin lint

since spin is the developer frontend.

@oscarbenjamin
Copy link
Collaborator

Okay this looks good. Thanks!

@oscarbenjamin oscarbenjamin merged commit 54beefc into flintlib:master Aug 30, 2024
40 checks passed
@fchapoton fchapoton deleted the cython-lint branch August 31, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants