Skip to content

Commit

Permalink
Add python to hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKora committed Dec 4, 2023
1 parent 0dc5866 commit 3db9be0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/_pre-commit-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pre-commit
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ls -al
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
pre-commit install
pre-commit run --all-files
working-directory: .
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
default_language_version:
python: python3.
# python: python3.11.4
# python: python3.
python: python3.11.4
default_stages: [pre-commit, manual]
exclude: ".*tmps.*"

repos:
# - repo: local
# hooks:
# - id: auto-doc
# language: python
# name: Generate doc
# types:
# - "python"
# - "file"
# entry: python3 generate-doc.py
- repo: local
hooks:
- id: auto-doc
language: python
name: Generate doc
types:
- "python"
- "file"
entry: python3 generate-doc.py

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
Expand Down
5 changes: 2 additions & 3 deletions custom_pre_commit.py → generate-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ def copy_file(source_path, destination_path):
try:
# Copy the file from source_path to destination_path
shutil.copy(source_path, destination_path)
print_colored(
f"File updated successfully: {destination_path}", Colors.BLUE)
except FileNotFoundError:
print_colored(f"Source file not found.", Colors.RED)
except PermissionError:
Expand Down Expand Up @@ -143,12 +141,13 @@ def run():
print_colored("√ Documentation up to date", Colors.GREEN)
else:
print_colored(
"Error: The documentation is not up to date. Re running pre-commit may help.", Colors.RED)
"\nError: The documentation is not up to date. Re running pre-commit may help.", Colors.RED)
os._exit(1)

# remove tmp dir
if os.path.exists("./tmps"):
shutil.rmtree("./tmps")


if __name__ == "__main__":
run()

0 comments on commit 3db9be0

Please sign in to comment.