Skip to content

Commit

Permalink
feat(style): add toml-sort (#626)
Browse files Browse the repository at this point in the history
* docs: use bullet in PR template, so GitHub will expand in the preview
  • Loading branch information
andreoliwa authored Nov 4, 2023
1 parent bfcb458 commit a4aeef7
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Issues fixed by this pull request:
Fix #

- Fix #

## Proposed changes

Expand Down
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,17 @@ shell
- `ShellCheck (static analysis for shell scripts) <https://github.com/koalaman/shellcheck>`_
* - `py://nitpick/resources/shell/shfmt <src/nitpick/resources/shell/shfmt.toml>`_
- `shfmt (shell script formatter) <https://github.com/mvdan/sh>`_

toml
~~~~

.. list-table::
:header-rows: 1

* - Style URL
- Description
* - `py://nitpick/resources/toml/toml-sort <src/nitpick/resources/toml/toml-sort.toml>`_
- `TOML sort <https://github.com/pappasam/toml-sort>`_
.. auto-generated-end-style-library
Quickstart
Expand Down
11 changes: 11 additions & 0 deletions docs/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,14 @@ shell
- `ShellCheck (static analysis for shell scripts) <https://github.com/koalaman/shellcheck>`_
* - :gitref:`py://nitpick/resources/shell/shfmt <src/nitpick/resources/shell/shfmt.toml>`
- `shfmt (shell script formatter) <https://github.com/mvdan/sh>`_

toml
~~~~

.. list-table::
:header-rows: 1

* - Style URL
- Description
* - :gitref:`py://nitpick/resources/toml/toml-sort <src/nitpick/resources/toml/toml-sort.toml>`
- `TOML sort <https://github.com/pappasam/toml-sort>`_
84 changes: 44 additions & 40 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,71 +1,75 @@
alabaster==0.7.13 ; python_version >= "3.8" and python_version < "4.0"
attrs==23.1.0 ; python_version >= "3.8" and python_version < "4.0"
autorepr==0.3.0 ; python_version >= "3.8" and python_version < "4.0"
babel==2.9.1 ; python_version >= "3.8" and python_version < "4.0"
cattrs==22.2.0 ; python_version >= "3.8" and python_version < "4.0"
babel==2.13.0 ; python_version >= "3.8" and python_version < "4.0"
cattrs==23.1.2 ; python_version >= "3.8" and python_version < "4.0"
certifi==2023.7.22 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==2.0.11 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==3.3.0 ; python_version >= "3.8" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32")
configupdater==3.1.1 ; python_version >= "3.8" and python_version < "4.0"
dictdiffer==0.9.0 ; python_version >= "3.8" and python_version < "4.0"
docutils==0.19 ; python_version >= "3.8" and python_version < "4.0"
docutils==0.18.1 ; python_version >= "3.8" and python_version < "4.0"
dpath==2.1.6 ; python_version >= "3.8" and python_version < "4.0"
exceptiongroup==1.1.1 ; python_version >= "3.8" and python_version < "3.11"
flake8==3.9.2 ; python_version >= "3.8" and python_version < "4.0"
exceptiongroup==1.1.3 ; python_version >= "3.8" and python_version < "3.11"
flake8==5.0.4 ; python_version >= "3.8" and python_version < "4.0"
flatten-dict==0.4.2 ; python_version >= "3.8" and python_version < "4.0"
furl==2.1.3 ; python_version >= "3.8" and python_version < "4.0"
identify==2.5.31 ; python_version >= "3.8" and python_version < "4.0"
idna==3.3 ; python_version >= "3.8" and python_version < "4.0"
imagesize==1.3.0 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==4.13.0 ; python_version >= "3.8" and python_version < "3.10"
importlib-resources==5.12.0 ; python_version >= "3.8" and python_version < "3.9"
iniconfig==1.1.1 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.0.3 ; python_version >= "3.8" and python_version < "4.0"
identify==2.5.30 ; python_version >= "3.8" and python_version < "4.0"
idna==3.4 ; python_version >= "3.8" and python_version < "4.0"
imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==6.8.0 ; python_version >= "3.8" and python_version < "3.10"
importlib-resources==6.1.0 ; python_version >= "3.8" and python_version < "3.9"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "4.0"
jmespath==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
jsonschema==4.4.0 ; python_version >= "3.8" and python_version < "4.0"
loguru==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
jsonschema-specifications==2023.7.1 ; python_version >= "3.8" and python_version < "4.0"
jsonschema==4.19.1 ; python_version >= "3.8" and python_version < "4.0"
loguru==0.7.2 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.1.3 ; python_version >= "3.8" and python_version < "4.0"
marshmallow-polyfield==5.11 ; python_version >= "3.8" and python_version < "4.0"
marshmallow==3.19.0 ; python_version >= "3.8" and python_version < "4.0"
mccabe==0.6.1 ; python_version >= "3.8" and python_version < "4.0"
more-itertools==9.1.0 ; python_version >= "3.8" and python_version < "4.0"
marshmallow==3.20.1 ; python_version >= "3.8" and python_version < "4.0"
mccabe==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
more-itertools==10.1.0 ; python_version >= "3.8" and python_version < "4.0"
orderedmultidict==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
packaging==21.3 ; python_version >= "3.8" and python_version < "4.0"
platformdirs==3.1.1 ; python_version >= "3.8" and python_version < "4.0"
pluggy==1.0.0 ; python_version >= "3.8" and python_version < "4.0"
pycodestyle==2.7.0 ; python_version >= "3.8" and python_version < "4.0"
pyflakes==2.3.1 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.15.0 ; python_version >= "3.8" and python_version < "4.0"
pyparsing==3.0.7 ; python_version >= "3.8" and python_version < "4.0"
pyrsistent==0.18.1 ; python_version >= "3.8" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.8" and python_version < "4.0"
pkgutil-resolve-name==1.3.10 ; python_version >= "3.8" and python_version < "3.9"
platformdirs==3.11.0 ; python_version >= "3.8" and python_version < "4.0"
pluggy==1.3.0 ; python_version >= "3.8" and python_version < "4.0"
pycodestyle==2.9.1 ; python_version >= "3.8" and python_version < "4.0"
pyflakes==2.5.0 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.16.1 ; python_version >= "3.8" and python_version < "4.0"
pytest-socket==0.6.0 ; python_version >= "3.8" and python_version < "4.0"
pytest==7.3.1 ; python_version >= "3.8" and python_version < "4.0"
pytest==7.4.2 ; python_version >= "3.8" and python_version < "4.0"
python-slugify==8.0.1 ; python_version >= "3.8" and python_version < "4.0"
pytz==2021.3 ; python_version >= "3.8" and python_version < "4.0"
requests-cache==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
pytz==2023.3.post1 ; python_version >= "3.8" and python_version < "3.9"
referencing==0.30.2 ; python_version >= "3.8" and python_version < "4.0"
requests-cache==1.1.0 ; python_version >= "3.8" and python_version < "4.0"
requests==2.31.0 ; python_version >= "3.8" and python_version < "4.0"
ruamel-yaml-clib==0.2.7 ; platform_python_implementation == "CPython" and python_version < "3.12" and python_version >= "3.8"
ruamel-yaml==0.17.28 ; python_version >= "3.8" and python_version < "4.0"
rpds-py==0.10.6 ; python_version >= "3.8" and python_version < "4.0"
ruamel-yaml-clib==0.2.8 ; platform_python_implementation == "CPython" and python_version < "3.13" and python_version >= "3.8"
ruamel-yaml==0.17.40 ; python_version >= "3.8" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.8" and python_version < "4.0"
snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "4.0"
sortedcontainers==2.4.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx-gitref==0.2.1 ; python_version >= "3.8" and python_version < "4.0"
sphinx-rtd-theme==0.5.1 ; python_version >= "3.8" and python_version < "4.0"
sphinx-rtd-theme==1.3.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx==6.2.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-jquery==4.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.8" and python_version < "4.0"
sphobjinv==2.3.1 ; python_version >= "3.8" and python_version < "4.0"
strenum==0.4.10 ; python_version >= "3.8" and python_version < "4.0"
strenum==0.4.15 ; python_version >= "3.8" and python_version < "4.0"
text-unidecode==1.3 ; python_version >= "3.8" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0"
tomli==2.0.0 ; python_version >= "3.8" and python_version < "3.11"
tomlkit==0.11.8 ; python_version >= "3.8" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.11"
tomlkit==0.12.1 ; python_version >= "3.8" and python_version < "4.0"
typing-extensions==4.8.0 ; python_version >= "3.8" and python_version < "3.11"
url-normalize==1.4.3 ; python_version >= "3.8" and python_version < "4.0"
urllib3==1.26.18 ; python_version >= "3.8" and python_version < "4.0"
urllib3==2.0.7 ; python_version >= "3.8" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "win32"
zipp==3.7.0 ; python_version >= "3.8" and python_version < "3.10"
zipp==3.17.0 ; python_version >= "3.8" and python_version < "3.10"
1 change: 1 addition & 0 deletions docs/source/nitpick.resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Subpackages
nitpick.resources.proto
nitpick.resources.python
nitpick.resources.shell
nitpick.resources.toml
7 changes: 7 additions & 0 deletions docs/source/nitpick.resources.toml.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nitpick.resources.toml package
==============================

.. automodule:: nitpick.resources.toml
:members:
:undoc-members:
:show-inheritance:
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/nitpick/resources/toml/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Styles for TOML files."""
15 changes: 15 additions & 0 deletions src/nitpick/resources/toml/toml-sort.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[nitpick.meta]
name = "TOML sort"
url = "https://github.com/pappasam/toml-sort"

[[".pre-commit-config.yaml".repos]]
repo = "https://github.com/pappasam/toml-sort"

[[".pre-commit-config.yaml".repos.hooks]]
id = "toml-sort-fix"

["pyproject.toml".tool.tomlsort]
all = true
ignore_case = true
in_place = true
trailing_comma_inline_array = true
4 changes: 4 additions & 0 deletions tests/test_builtin/toml/toml-sort/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
repos:
- repo: https://github.com/pappasam/toml-sort
hooks:
- id: toml-sort-fix
5 changes: 5 additions & 0 deletions tests/test_builtin/toml/toml-sort/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.tomlsort]
all = true
ignore_case = true
in_place = true
trailing_comma_inline_array = true

0 comments on commit a4aeef7

Please sign in to comment.