Skip to content

Commit

Permalink
Add pre-commit hook configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bneijt committed Apr 11, 2021
1 parent 632aaec commit 26f97d7
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ Simply put, the workflow is as follows
cat pyproject.toml
poetry install

Contributing code
-----------------

- Open an issue
- Create an associated PR
- Make sure to black format the proposed change

poetry run pre-commit install

- Add tests where possible

License
-------
GPLv3, use at your own risk.
Expand Down
171 changes: 169 additions & 2 deletions poetry.lock

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

4 changes: 3 additions & 1 deletion poetry_lock_package/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def run(should_create_tests: bool) -> None:
project["tool"]["poetry"]["description"] + " lock package"
).strip()
project["tool"]["poetry"]["dependencies"] = dependencies
del_keys(project["tool"]["poetry"], ['scripts'])

del_keys(project["tool"]["poetry"], ["scripts"])

create_or_update(project, should_create_tests)


Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
repository = "https://github.com/bneijt/poetry-lock-package"

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.6.1"
toml = "^0.10.2"
click = "^7.1.2"
importlib-metadata = { version = "^3.10.0", python = "<3.8" }
Expand All @@ -19,6 +19,7 @@ pytest = "^5.2"
black = "^20.8b1"
rope = "^0.18.0"
twine = "^3.4.1"
pre-commit = "^2.12.0"

[tool.poetry.scripts]
poetry-lock-package = 'poetry_lock_package.app:main'
Expand Down
4 changes: 3 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/bash
poetry run poetry-lock-package
cd "$(dirname "$0")"
poetry run poetry-lock-package
cat poetry-lock-package-lock/pyproject.toml

0 comments on commit 26f97d7

Please sign in to comment.