-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add intersphinx_registry and toml-sort #1314
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1314 +/- ##
=======================================
Coverage 97.46% 97.46%
=======================================
Files 40 40
Lines 8840 8840
=======================================
Hits 8616 8616
Misses 224 224 ☔ View full report in Codecov by Sentry. |
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.
I suggest adding the following to pyproject.toml
:
[tool.tomlsort]
sort_table_keys = true
sort_inline_tables = true
sort_inline_arrays = true
spaces_before_inline_comment = 2
spaces_indent_inline_array = 4
trailing_comma_inline_array = true
the sort_*
settings will make order fully deterministic, and the other settings will make the result more similar to how ruff
formats python code, which IMO makes manual edits slightly easier (e.g., hitting TAB in the IDE will yield the right number of spaces by default)
I was certain I putted:
But now I can't find it.. |
yep, confirmed that Your point about spacing is true --- users can configure their IDEs to do tabs differently for different file formats. But if we use the setting I suggested, they won't need to do that... though I guess it's possible that my suggested setting will lead folks to need to undo their 2-space tab settings? For other settings though (e.g., 2 spaces before inline comments) it's less about IDEs and more about muscle memory: chances are if I'm typing an inline comment I'll use 2 spaces, and when reading code I'm used to things being looking a certain way (I'm guessing that's why you added trailing comma --- after months/years of using black/ruff, it's starting to look "wrong" if it's not there?) If you're not convinced that's OK. I don't insist on anything other than the sorting, which you've already done. |
I completely agree and wil ladd the 2 spaces before inline comments at least ;)
My issue here, is that TBH, I don't think I actually configured anything here and yet that's the default I got (it might be from the |
for more information, see https://pre-commit.ci
Add
toml-sort
andintersphinx_registry
to the tooling chain.Closes #1300