Skip to content

Commit

Permalink
feat/check-v2 rename folder hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
hminaee-tc committed Jul 2, 2024
1 parent fcc7516 commit 4a141af
Show file tree
Hide file tree
Showing 29 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
with:
python-version: '3.11'
- name: install-dependencies
run: pip install -r hooks/pypi_bumpversion_check_package/pypi_bumpversion_check/requirements.txt
run: pip install -r opencepk_lib_python_common/pypi_bumpversion_check_package/pypi_bumpversion_check/requirements.txt
- name: pre-commit-run
uses: pre-commit/action@v3.0.0
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python-version: 3.11

- name: Run tests
run: python3 -m unittest hooks.find_and_replace_strings_package.tests.test_main
run: python3 -m unittest opencepk_lib_python_common.find_and_replace_strings_package.tests.test_main
# ----------------------
# JOB 2: Run python package end to end test
# ----------------------
Expand All @@ -48,7 +48,7 @@ jobs:

- name: Run test-package-e2e.sh
run: |
cd hooks/find_and_replace_strings_package/tests-package-e2e
cd opencepk_lib_python_common/find_and_replace_strings_package/tests-package-e2e
./test-package-e2e.sh
# ----------------------
# JOB 3: Run pre-commit hook test
Expand All @@ -70,5 +70,5 @@ jobs:
- name: Run test-pre-commit-hook.sh
run: |
pip install pre-commit
cd hooks/find_and_replace_strings_package/tests-pre-commit-hook
cd opencepk_lib_python_common/find_and_replace_strings_package/tests-pre-commit-hook
./test-pre-commit-hook.sh
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ repos:
hooks:
- id: install-pypi_bumpversion_check-requirements
name: Install PYPI bumpversion check requirements
entry: sh -c 'pip3 install -r ./hooks/pypi_bumpversion_check_package/pypi_bumpversion_check/requirements.txt && exit 0'
entry: sh -c 'pip3 install -r ./opencepk_lib_python_common/pypi_bumpversion_check_package/pypi_bumpversion_check/requirements.txt && exit 0'
language: system
always_run: true

Expand All @@ -77,7 +77,7 @@ repos:
- id: pypi_bumpversion_check
name: Check version
args: ['./pyproject.toml']
entry: python3 -m hooks.pypi_bumpversion_check_package.pypi_bumpversion_check
entry: python3 -m opencepk_lib_python_common.pypi_bumpversion_check_package.pypi_bumpversion_check
language: system
pass_filenames: false # Do not pass filenames to the hook (this is important to keep)

Expand All @@ -86,7 +86,7 @@ repos:
hooks:
- id: unittest
name: Run unit tests
entry: python3 -m unittest hooks.find_and_replace_strings_package.tests.test_main
entry: python3 -m unittest opencepk_lib_python_common.find_and_replace_strings_package.tests.test_main
language: system
pass_filenames: false
always_run: true
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ repos:
hooks:
- id: find-and-replace-strings
name: find-and-replace-strings
entry: "./hooks/find_and_replace_strings_package/find_and_replace_strings/main.py"
entry: "./opencepk_lib_python_common/find_and_replace_strings_package/find_and_replace_strings/main.py"
language: python
exclude_types:
- binary
args: ["--config", "./hooks/find_and_replace_strings_package/tests-pre-commit-hook/.find-and-replace.json"]
args: ["--config", "./opencepk_lib_python_common/find_and_replace_strings_package/tests-pre-commit-hook/.find-and-replace.json"]
files: "find_and_replace_strings_package/tests-pre-commit-hook/README_TEST_PRE_COMMIT\\.md$"
# we need $ to terminate the check to avoid .md.template to be picked by hook
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

TEST_DIR_FROM_ROOT="hooks/find_and_replace_strings_package/tests-pre-commit-hook"
TEST_DIR_FROM_ROOT="opencepk_lib_python_common/find_and_replace_strings_package/tests-pre-commit-hook"
TEST_DIR="tests-pre-commit-hook"
TEST_SCRIPT_FILENAME=$(basename -- "$0")
TEST_SCRIPT_NAME="${TEST_SCRIPT_FILENAME%.*}"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ classifiers = [
]

[project.entry-points."console_scripts"]
python-pypi-version-check = "hooks.pypi_bumpversion_check_package.pypi_bumpversion_check.main:main"
find-and-replace-strings = "hooks.find_and_replace_strings_package.find_and_replace_strings.main:main"
python-pypi-version-check = "opencepk_lib_python_common.pypi_bumpversion_check_package.pypi_bumpversion_check.main:main"
find-and-replace-strings = "opencepk_lib_python_common.find_and_replace_strings_package.find_and_replace_strings.main:main"

0 comments on commit 4a141af

Please sign in to comment.