Skip to content

Commit

Permalink
pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Nov 8, 2023
1 parent 1e67711 commit fe98362
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/config.toml
/data/
/html/
node_modules/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/hydrogen
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.0
hooks:
# blocks files larger than 500 KB
- id: check-added-large-files

# blocks files with leftover merge conflict markers
- id: check-merge-conflict

- id: no-commit-to-branch
name: Block commits to main branch

- repo: local
hooks:
- id: ruff
name: Lint files with ruff
args: [check, --target-version, py311, --fix, --show-fixes]
entry: ruff
language: system
types: [python]

- id: black
name: Format files with black
args: [-t, py311]
entry: black
language: system
types: [python]

- id: prettier
name: Format files with prettier
args: [prettier, -l, -u, -w]
entry: npx
exclude: \.py$
language: system
types: [text]
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
119 changes: 119 additions & 0 deletions package-lock.json

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

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"devDependencies": {
"prettier": "^3.0.3",
"prettier-plugin-toml": "^1.0.0"
},
"prettier": {
"plugins": [
"prettier",
"prettier-plugin-toml"
]
}
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ packages = ["aethersprite"]
dependencies = { file = "requirements/requirements.txt" }

[tool.setuptools.dynamic.optional-dependencies]
dev = { file = "requirements/dev.txt" }
docs = { file = "requirements/docs.txt" }

[tool.black]
Expand Down
1 change: 1 addition & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pre-commit
27 changes: 27 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile dev.in
#
cfgv==3.4.0
# via pre-commit
distlib==0.3.7
# via virtualenv
filelock==3.13.1
# via virtualenv
identify==2.5.31
# via pre-commit
nodeenv==1.8.0
# via pre-commit
platformdirs==3.11.0
# via virtualenv
pre-commit==3.5.0
# via -r dev.in
pyyaml==6.0.1
# via pre-commit
virtualenv==20.24.6
# via pre-commit

# The following packages are considered to be unsafe in a requirements file:
# setuptools

0 comments on commit fe98362

Please sign in to comment.