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
Use ruff as linter in pre-commit and GH autotest #6538
Comments
3 tasks
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
UTF-8 is the default source encoding in Python 3. Declaring it is unncessary, unless Python 2 is also supported. See also: - https://peps.python.org/pep-3120/ - https://docs.python.org/3/howto/unicode.html#python-s-unicode-support - https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
UTF-8 is the default source encoding in Python 3. Declaring it is unncessary, unless Python 2 is also supported. See also: - https://peps.python.org/pep-3120/ - https://docs.python.org/3/howto/unicode.html#python-s-unicode-support - https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
Since Python 3, all classes inherit from object by default, so object can be omitted from the list of base classes. See also: - https://docs.astral.sh/ruff/rules/useless-object-inheritance/ - https://peps.python.org/pep-3115/
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
In Python3.3+, a variety of exceptions (such as IOError) were aliased to OSError, with the latter being the preferred exception to use. See also: - https://docs.python.org/3/library/exceptions.html#OSError - https://stackoverflow.com/questions/29347790/difference-between-ioerror-and-oserror - https://docs.astral.sh/ruff/rules/os-error-alias/
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
UTF-8 is the default encoding in Python, so there is no need to call encode when UTF-8 is the desired encoding. Instead, use a bytes literal. See also: - https://docs.astral.sh/ruff/rules/unnecessary-encode-utf8/
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
Pyupgrade is a linter to check for deprecated Python syntax. This commit configures ruff to perform pyupgrade linting. In the ignore list, I added some pyupgrade error codes (UP*) for the moment. These must either be fixed manually, or might be controversial in some way, so we can consider them at a later point.
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 18, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 19, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 19, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 19, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 19, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 19, 2024
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Mar 19, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
bari12
pushed a commit
that referenced
this issue
Mar 20, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
bari12
pushed a commit
that referenced
this issue
Mar 20, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
bari12
changed the title
Consider using ruff as linter in pre-commit and GH autotest
USe ruff as linter in pre-commit and GH autotest
Mar 20, 2024
bari12
changed the title
USe ruff as linter in pre-commit and GH autotest
Use ruff as linter in pre-commit and GH autotest
Mar 20, 2024
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
…6538 rucio is detected as a third-party dependency by default (likely has to do with the project structure or __init__ files). This change configures isort to treat rucio as a first-party dependency, and re-formats the files.
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
UTF-8 is the default source encoding in Python 3. Declaring it is unncessary, unless Python 2 is also supported. See also: - https://peps.python.org/pep-3120/ - https://docs.python.org/3/howto/unicode.html#python-s-unicode-support - https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
Since Python 3, all classes inherit from object by default, so object can be omitted from the list of base classes. See also: - https://docs.astral.sh/ruff/rules/useless-object-inheritance/ - https://peps.python.org/pep-3115/
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
In Python3.3+, a variety of exceptions (such as IOError) were aliased to OSError, with the latter being the preferred exception to use. See also: - https://docs.python.org/3/library/exceptions.html#OSError - https://stackoverflow.com/questions/29347790/difference-between-ioerror-and-oserror - https://docs.astral.sh/ruff/rules/os-error-alias/
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
UTF-8 is the default encoding in Python, so there is no need to call encode when UTF-8 is the desired encoding. Instead, use a bytes literal. See also: - https://docs.astral.sh/ruff/rules/unnecessary-encode-utf8/
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
Pyupgrade is a linter to check for deprecated Python syntax. This commit configures ruff to perform pyupgrade linting. In the ignore list, I added some pyupgrade error codes (UP*) for the moment. These must either be fixed manually, or might be controversial in some way, so we can consider them at a later point.
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
bari12
pushed a commit
that referenced
this issue
Mar 21, 2024
…6538 rucio is detected as a third-party dependency by default (likely has to do with the project structure or __init__ files). This change configures isort to treat rucio as a first-party dependency, and re-formats the files.
rdimaio
added a commit
to rdimaio/rucio
that referenced
this issue
Apr 2, 2024
bari12
pushed a commit
that referenced
this issue
Apr 2, 2024
UTF-8 is the default source encoding in Python 3. Declaring it is unncessary, unless Python 2 is also supported. See also: - https://peps.python.org/pep-3120/ - https://docs.python.org/3/howto/unicode.html#python-s-unicode-support - https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
Adding Ruff to both the pre-commit script (with --fix passed, thus sorting imports automatically) and to GH autotest (checking only). Ruff is currently only configured to check for import sorting. Other linting functions (flake8, pyupgrade) will be added progressively.
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
UTF-8 is the default source encoding in Python 3. Declaring it is unncessary, unless Python 2 is also supported. See also: - https://peps.python.org/pep-3120/ - https://docs.python.org/3/howto/unicode.html#python-s-unicode-support - https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
UTF-8 is the default source encoding in Python 3. Declaring it is unncessary, unless Python 2 is also supported. See also: - https://peps.python.org/pep-3120/ - https://docs.python.org/3/howto/unicode.html#python-s-unicode-support - https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
Since Python 3, all classes inherit from object by default, so object can be omitted from the list of base classes. See also: - https://docs.astral.sh/ruff/rules/useless-object-inheritance/ - https://peps.python.org/pep-3115/
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
In Python3.3+, a variety of exceptions (such as IOError) were aliased to OSError, with the latter being the preferred exception to use. See also: - https://docs.python.org/3/library/exceptions.html#OSError - https://stackoverflow.com/questions/29347790/difference-between-ioerror-and-oserror - https://docs.astral.sh/ruff/rules/os-error-alias/
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
See also: - UP034
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
UTF-8 is the default encoding in Python, so there is no need to call encode when UTF-8 is the desired encoding. Instead, use a bytes literal. See also: - https://docs.astral.sh/ruff/rules/unnecessary-encode-utf8/
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
Pyupgrade is a linter to check for deprecated Python syntax. This commit configures ruff to perform pyupgrade linting. In the ignore list, I added some pyupgrade error codes (UP*) for the moment. These must either be fixed manually, or might be controversial in some way, so we can consider them at a later point.
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
voetberg
pushed a commit
to voetberg/rucio
that referenced
this issue
Apr 15, 2024
…ucio#6538 rucio is detected as a third-party dependency by default (likely has to do with the project structure or __init__ files). This change configures isort to treat rucio as a first-party dependency, and re-formats the files.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruff is a Python linter that seems to be very widely used, fast and configurable. It replaces
flake8
,isort
, and other tools.I think it might be worth adding
ruff
in the pre-commit hook (https://github.com/astral-sh/ruff-pre-commit), instead of isort (#6532), and configuring it to our needs.Additionally, in the GH autotest workflow (https://github.com/rucio/rucio/blob/master/.github/workflows/autotest.yml), we could replace
add_header
,python_annotations
andpython_pyright
with eitherpre-commit/action
(https://github.com/pre-commit/action?tab=readme-ov-file) or https://pre-commit.ci/.autotest.yml
- we can just pointautotest.yml
to run the checks in the precommit config, keeping them "in sync"The text was updated successfully, but these errors were encountered: