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

Added ruff for pre-commit check #885

Merged
merged 3 commits into from
Jun 24, 2024
Merged

Added ruff for pre-commit check #885

merged 3 commits into from
Jun 24, 2024

Conversation

liudmylaru
Copy link
Member

@liudmylaru liudmylaru commented Jun 19, 2024

Description

Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort, pydocstyle, and more, all while executing tens or hundreds of times faster than any individual tool.

Added ruff to run mainly default settings with little extra and exclude. While developing our code we will add/exclude more. Please check on rules and suggest what can be added to default (section 'select' in pyproject.toml) and what can be excluded (section 'ignore' in pyproject.toml)- https://docs.astral.sh/ruff/rules/.

What was done

  • added repo to .pre-commit-config.yaml
  • added rules to pyproject.toml
  • removed black, because ruff has drop-in parity with it

- added repo to .pre-commit-config.yaml
- added rules to pyproject.toml
- removed black, because ruff has drop-in parity with it
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 19, 2024
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

mrDzurb
mrDzurb previously approved these changes Jun 19, 2024
darenr
darenr previously approved these changes Jun 19, 2024
Copy link
Member

@darenr darenr left a comment

Choose a reason for hiding this comment

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

With the defaults do you find that ads builds fine? I found that I had to use the ruff conf that I shared to exclude various things otherwise it would flag a number or issues. If you don't find that then go ahead. Thanks for finishing this.

Copy link

📌 Cov diff with main:

No lines with coverage information in this diff.

📌 Overall coverage:

Coverage-61.53%

- added ignore and extended-select
- added types_or: [ python, pyi, jupyter ] to config
@liudmylaru liudmylaru dismissed stale reviews from darenr and mrDzurb via 7986f45 June 20, 2024 15:00
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

Copy link

📌 Cov diff with main:

No lines with coverage information in this diff.

📌 Overall coverage:

Coverage-61.53%

Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

Copy link

📌 Cov diff with main:

No lines with coverage information in this diff.

📌 Overall coverage:

Coverage-61.53%

@liudmylaru liudmylaru merged commit b7b7ae1 into main Jun 24, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants