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

add ruff and remove redundant pre-commits #278

Merged
merged 18 commits into from
Feb 16, 2023
Merged

add ruff and remove redundant pre-commits #278

merged 18 commits into from
Feb 16, 2023

Conversation

giovp
Copy link
Contributor

@giovp giovp commented Feb 14, 2023

replace flake8 and a bunch of other pre-commit with https://github.com/charliermarsh/ruff, a faster alternative.

If accepted/in scopre, merge only after #269

@giovp
Copy link
Contributor Author

giovp commented Feb 14, 2023

I think nbqa are the slowest pre-commits at the moment but there is no first-party integration. I think it'd also make sense to remove some of the pre-commit/pre-commit-hooks, that could be replaced for example by prettier ?

@giovp
Copy link
Contributor Author

giovp commented Feb 14, 2023

now there are "E","F","W","I", with autofix, which would introduce way too many changes in docs and tests and maybe it should be done later on (more stable repo, not today), so I explicitly removed them.

src/ott/geometry/costs.py Outdated Show resolved Hide resolved
src/ott/geometry/costs.py Outdated Show resolved Hide resolved
src/ott/geometry/costs.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@michalk8
Copy link
Collaborator

now there are "E","F","W","I", with autofix, which would introduce way too many changes in docs and tests and maybe it should be done later on (more stable repo, not today), so I explicitly removed them.

Perfect, can you create another issue after this one is merged for this?
LGTM, merging this since the linter passing, thanks @giovp !

@michalk8 michalk8 merged commit ab9d89f into ott-jax:main Feb 16, 2023
michalk8 pushed a commit that referenced this pull request Jun 27, 2024
* fix D101 and B028 (stack level for warnings) introduced in #219

* add vscode to gitignore

* fix D102 on costs.py and try to simplify inheritance methods

* try to fix D102 everywhere

* fix D103

* remove comment from .flake8

* add ruff to pyproject.toml

* add ruff

* add documentation on ruff select and add unfixable

* add target version

* add comment on tool.ruff

* pyproject.toml

* format

* remove artifcats from wrong merge

* address ruff comments

* fix ruff imports
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