You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that ruff linter with isort enabled is behaving differently for me when running locally (in a Linux machine with Ubuntu) vs in a Github action runner (running ubuntu-latest).
Locally, its not happy about the lack of line between yaml and RcloneHelper.
$ ruff check --config ./pyproject.toml ./backup.py
backup2.py:5:1: I001 [*] Import block is un-sorted or un-formatted
|
3 | """
4 |
5 | / import logging
6 | | import os
7 | | from typing import Annotated, List
8 | |
9 | | import typer
10 | | import yaml
11 | | from data_backup.rclone_helper import RcloneHelper
| |__________________________________________________^ I001
12 |
13 | logging.basicConfig(
|
= help: Organize imports
Found 1 error.
In a Github action runner its not happy with a line (ran below via tmate ssh session in the runner)
$ ruff check --config ./tools/data-backup/pyproject.toml ./tools/data-backup/backup.py
tools/data-backup/backup.py:5:1: I001 [*] Import block is un-sorted or un-formatted
|
3 | """
4 |
5 | / import logging
6 | | import os
7 | | from typing import Annotated, List
8 | |
9 | | import typer
10 | | import yaml
11 | |
12 | | from data_backup.rclone_helper import RcloneHelper
| |__________________________________________________^ I001
13 |
14 | logging.basicConfig(
|
= help: Organize imports
Found 1 error.
The reason for the difference seems to be that Ruff once categorizes data_backup as first party (locally) and as third-party (GitHub) dependencies and it then tries to group it with the other first/third-party imports. You can run ruff with ruff check --verbose and it should log how imports are categorizes.
Now, the reason why I think Ruff once detects data_backup as first-party locally but not on GitHub is because you run ruff from different directories. Ruff defaults to treat ./ and ./src as first-party and everything else as third-party (see src.
Can you try running ruff in the tools/data-backup directory on GitHub, the same as you do locally and let me know if that helped?
Description
I've noticed that ruff linter with isort enabled is behaving differently for me when running locally (in a Linux machine with Ubuntu) vs in a Github action runner (running ubuntu-latest).
Locally, its not happy about the lack of line between
yaml
andRcloneHelper
.In a Github action runner its not happy with a line (ran below via tmate ssh session in the runner)
My pyproject.toml is:
Any thoughts on what might be the issue here ?
The text was updated successfully, but these errors were encountered: