Skip to content

Commit 595b24a

Browse files
committed
Validate toml files
1 parent 4eef96f commit 595b24a

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ repos:
1111
- id: check-toml
1212
- id: check-added-large-files
1313
- repo: https://github.com/pycqa/flake8
14-
rev: '7.2.0'
14+
rev: '7.3.0'
1515
hooks:
1616
- id: flake8
17+
- repo: https://github.com/pappasam/toml-sort
18+
rev: 'v0.24.2'
19+
hooks:
20+
- id: toml-sort

noxfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@
5050

5151
@nox.session()
5252
def lint(session):
53-
"""Run flake8."""
54-
session.install("flake8")
53+
"""Run linters."""
54+
session.install("flake8", "toml-sort")
5555
# stop the linter if there are Python syntax errors or undefined names
5656
session.run("flake8", "--select=E9,F63,F7,F82", "--show-source")
5757
# exit-zero treats all errors as warnings
5858
session.run("flake8", "--exit-zero", "--max-complexity=10")
59+
# check the pyproject.toml file for correctness
60+
session.run("toml-sort", "--check", "pyproject.toml")
5961

6062

6163
def parametrize_test_versions():

0 commit comments

Comments
 (0)