-
-
Notifications
You must be signed in to change notification settings - Fork 6
split shed, format&sort toml+yaml #153
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
Conversation
| - hypothesis | ||
| - hypothesmith | ||
| - pytest | ||
| - flake8 | ||
| - trio | ||
| - anyio | ||
| - anyio | ||
| - flake8 | ||
| - hypothesis | ||
| - hypothesmith | ||
| - pytest | ||
| - trio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted
| - id: check-merge-conflict | ||
| - id: check-toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted, and added these two
| rev: 6.0.0 | ||
| hooks: | ||
| - id: flake8 | ||
| types_or: [python, pyi] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very important that this is types_or and not types, else it only checked stub files 😅
| - flake8-2020 | ||
| - flake8-bugbear | ||
| - flake8-builtins | ||
| - flake8-comprehensions | ||
| - flake8-datetimez | ||
| - flake8-docstrings | ||
| - flake8-mutable | ||
| - flake8-noqa | ||
| - flake8-pie | ||
| - flake8-pyi | ||
| - flake8-pytest-style | ||
| - flake8-return | ||
| - flake8-simplify | ||
| - flake8-type-checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted, and remove some duplicates (!!)
| - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
| rev: 0.2.2 | ||
| hooks: | ||
| - id: yamlfmt | ||
|
|
||
| - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
| rev: v2.7.0 | ||
| hooks: | ||
| - id: pretty-format-toml | ||
| args: [--autofix] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
| @@ -1,13 +1,30 @@ | |||
| [tool.pyright] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file sorted, and autoflake+isort added, pyright&codespell unchanged
| in_import: bool | None = None | ||
| with open(visitor_dir / "__init__.py") as f: | ||
| for line in f: | ||
| if m := re.match(r"from \. import (?P<module>\w*)", line): | ||
| if m := re.fullmatch(r"from \. import \(\n", line): | ||
| in_import = True | ||
| elif in_import and (m := re.fullmatch(r" *(?P<module>\w*),\n", line)): | ||
| visited_files.add(m.group("module")) | ||
| elif in_import and re.fullmatch(r"\)\n", line): | ||
| in_import = False | ||
|
|
||
| # check that parsing succeeded | ||
| assert in_import is False | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required new logic with formatting change in the __init__.py
| flake8_trio | ||
| */site-packages/flake8_trio | ||
|
|
||
| [flake8] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved so the coverage sections were next to eachother, and removed comment about Y021/Y048
|
What's the problem with just using Could the issue be addressed by disabling |
|
The current issue is very specifically that I want to disable But given how much I've fought with shed in the past with It's also sometimes been frustrating to track down why a diff is generated, when shed modifies a file I either have to debug, or manually run the underlying tools, if/when I want to know what tool it is that generated the diff. Sometimes this is for requesting bugs/features in those tools/shed, or when I want to know whether to add tl;dr, we could def go back to shed if you insist - but I do find it frustrating/limiting at times, aside from the current autoflake |
Zac-HD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
I'm always a bit 😥 when shed isn't the right choice, but in this case I agree it's better to use the underlying tools directly.
Split out shed for more granular control of the underlying tools, also added auto-formatting for yaml&toml and other minor config changes.