Skip to content

Releases: prog-time/git-hooks

3.0.0 | Added scripts for HTML, YML, CSS, Markdown

18 Feb 20:31
d4b0b20

Choose a tag to compare

What's Changed

Full Changelog: 2.0.0...3.0.0

2.0.0 | Added scripts for Python and JavaScript

06 Feb 16:08
66f696c

Choose a tag to compare

This release adds two new language modules — JavaScript/TypeScript and Python — expanding the collection of reusable git hook scripts beyond the original PHP/Laravel core.

What's New

JavaScript / TypeScript Hooks

Ten new scripts in javascript/ for projects built on Node.js, TypeScript, and frameworks like Next.js.

Linting & Formatting

Script Description
check_eslint_all.sh Runs ESLint with --fix across the entire project (app/, components/, lib/, types/)
check_prettier.sh Runs Prettier on staged .ts files passed as arguments
check_prettier_all.sh Runs Prettier on all TypeScript files using glob patterns
check_tsc_all.sh Runs TypeScript type checking via tsconfig.check.json

Python Hooks

Seven new scripts in python/ covering code style, static analysis, and testing — with both local and Docker execution modes.

Code Style

Script Description
check_flake8.sh Runs Flake8 locally on Python files (line length 120)
check_flake8_in_docker.sh Runs Flake8 inside the app_dev Docker container

Static Analysis

Script Description
check_mypy.sh Runs Mypy locally on changed app/*.py files
check_mypy_in_docker.sh Runs Mypy inside the Docker container, mapping host paths to container paths

Test Coverage

Both modules include full test suites following the project's existing test framework (tests/lib/test_helper.bash).

JavaScript — 3 suites, 10 test cases:

  • tests/javascript/tests_exist/ — 5 cases (no files, non-ts ignored, test exists, test missing, skip patterns)
  • tests/javascript/eslint_all/ — 2 cases (pass, fail)
  • tests/javascript/vitest/ — 3 cases (full suite, related files, failure)

Python — 7 suites, 26 test cases:

  • tests/python/flake8/ — 5 cases
  • tests/python/flake8_docker/ — 3 cases
  • tests/python/mypy/ — 4 cases
  • tests/python/mypy_docker/ — 3 cases
  • tests/python/pytest_local/ — 2 cases
  • tests/python/pytest_docker/ — 3 cases
  • tests/python/find_test/ — 6 cases

New test helpers added to tests/lib/test_helper.bash:

  • mock_npx(exit_code, output) — mocks npx for JavaScript hook testing
  • run_hook_at_depth(hook_path, depth, args...) — runs a hook script from a nested directory so that relative PROJECT_ROOT resolution works inside the test environment

CI/CD

GitHub Actions workflow (.github/workflows/tests.yml) now includes a javascript-tests job running in parallel with php-tests and python-tests, all gated by the shellcheck job.

1.0.0 | First build of scripts

01 Feb 17:47
dc14e58

Choose a tag to compare

This is the first collection of scripts that I use in my work.

What's Changed