Repository navigation
Conversation
|
|
||
| [tool.ruff.lint.per-file-ignores] | ||
| # needed for unasync.py | ||
| "httpcore/_sync/*" = ["I001"] | ||
| "tests/_sync/*" = ["I001"] |
There was a problem hiding this comment.
If remove this section, result will be:
>ruff check
httpcore\_sync\connection.py:1:1: I001 [*] Import block is un-sorted or un-formatted
httpcore\_sync\connection_pool.py:1:1: I001 [*] Import block is un-sorted or un-formatted
httpcore\_sync\socks_proxy.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tests\_sync\test_connection.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tests\_sync\test_connection_pool.py:1:1: I001 [*] Import block is un-sorted or un-formatted
Found 5 errors.
[*] 5 fixable with the `--fix` option.Maybe we also could use in-file rule ignore for them?
There was a problem hiding this comment.
Do we really need to avoid excluding sync directories? When we need to format/lint them? they are auto generated.
There was a problem hiding this comment.
They are pre-generated. it means currently, they are already available in sdist, wheels and repository.
It doesn't look good that readers navigate through unformatted sources after installation.
For example, after installation, I'll navigate to site-packages/httpcore then in _sync folder's contents I open a single file, then I'll see linter/formatter warnings in my IDE.
There was a problem hiding this comment.
When it's possible to have them, why excluding them?
There was a problem hiding this comment.
I'll navigate to site-packages/httpcore then in _sync folder's contents I open a single file, then I'll see linter/formatter warnings in my IDE.
I believe it is typical to see such situations because IDE rules and rules used for linting source files are not always in sync.
When it's possible to have them, why excluding them?
We can, for the time being, ignore I001 for those files, but we don't know how many additional rules may be broken when introducing a new feature. We need add new rules that break sync files into the configuration every time, which makes the maintenance process more difficult.
There was a problem hiding this comment.
we don't know how many additional rules may be broken when introducing a new feature. We need add new rules that break sync files into the configuration every time, which makes the maintenance process more difficult.
The codebase is almost stable, I think the only violation rule would be import sorting violation. by checking unasync.py script I don't except new violation happening when adding new feature other than I001 (and F811 which can be in-line ignoring this without changing pyproject.toml)
IMO, we could give it a try, since always doable in future to revert this change.
_sync folders, Used default line-length
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Summary
Same as what's done on httpx: encode/httpx#2922
Checklist