Skip to content

Commit

Permalink
Add pyproject-fmt command
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Sep 27, 2024
1 parent 651a4b4 commit 3a9e494
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ By utilizing `hatch`, the following commands are available to manage the develop
| `hatch fmt --formatter` | Run only formatters |
| `hatch run precommit:check` | Run all [`pre-commit`](https://pre-commit.com/) checks configured within this repository |
| `hatch run precommit:update` | Update the [`pre-commit`](https://pre-commit.com/) hooks configured within this repository |
| `hatch run pyproject:format` | Format the `pyproject.toml` file using [`pyproject-fmt`](https://github.com/tox-dev/pyproject-fmt) |

### Documentation

| Command | Description |
| --- | --- |
| `hatch run docs:serve` | Start the `mkdocs` server to view documentation locally |
| `hatch run docs:serve` | Start the [`mkdocs`](https://www.mkdocs.org/) server to view documentation locally |
| `hatch run docs:build` | Build the documentation |
| `hatch run docs:linkcheck` | Check for broken links in the documentation |

Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ dependencies = [ "pre-commit>=3,<4" ]
check = [ "pre-commit run --all-files" ]
update = [ "pre-commit autoupdate" ]

#
# pyproject-format
#
[tool.hatch.envs.pyproject]
template = "pyproject"
detached = true
dependencies = [ "pyproject-fmt" ]

[tool.hatch.envs.pyproject.scripts]
format = [ "pyproject-fmt pyproject.toml" ]

#
# Tools
#
Expand Down

0 comments on commit 3a9e494

Please sign in to comment.