Skip to content

Commit

Permalink
288 - Alterando pre-commit hook para pre-push (#291)
Browse files Browse the repository at this point in the history
* adjusting format to actually fix errors

* removing pre-commit

* adjusting to register a different githooks path

* adding pre-push hook

* linting

* testing import error

* linting

* adjusting format and check commands

* adjusting pre-push

* atualizando changelog com pull 288

* Update CHANGELOG.md

Co-authored-by: Camila Maia <cmaiacd@gmail.com>

* Update .githooks/pre-push

Co-authored-by: Camila Maia <cmaiacd@gmail.com>

---------

Co-authored-by: Marcel Cattaneo <marcel.cattaneo@deal.com.br>
Co-authored-by: Camila Maia <cmaiacd@gmail.com>
  • Loading branch information
3 people committed Nov 28, 2023
1 parent 388c671 commit 800f839
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 212 deletions.
6 changes: 6 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printf "Running pre-push hook checks\n\n"

make check

bash -c "if [[ $? != 0 ]];then printf '\nPlease run the following command before push:\n\n make format\n\n\
Remember to commit any changes made on the process.\n'; exit 1; fi"
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml

This file was deleted.

9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
install:
git config --local core.hooksPath .githooks/
chmod -R +x .githooks
@poetry install
@poetry run pre-commit install -f -t pre-commit --hook-type commit-msg

shell:
@poetry shell
Expand All @@ -9,12 +10,10 @@ run-python:
@poetry run python

format:
@poetry run ruff format .
@poetry run ruff .
@poetry run ruff check . --fix

check:
@poetry run ruff format . --check
@poetry run ruff .
@poetry run ruff check .

test:
@PYTHONDONTWRITEBYTECODE=1 poetry run python3 -m unittest discover tests/ -v
196 changes: 1 addition & 195 deletions poetry.lock

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

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ python = "^3.8.1"
coverage = "^7.2.7"

[tool.poetry.group.dev.dependencies]
pre-commit = ">=2.21,<4.0"
ruff = "^0.1.4"

[tool.ruff]
Expand Down
3 changes: 0 additions & 3 deletions scripts/make-format.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_phone.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
generate_landline_phone,
generate_mobile_phone,
is_valid,
remove_symbols_phone,
remove_international_code_phone,
remove_symbols_phone,
)


Expand Down

0 comments on commit 800f839

Please sign in to comment.