Skip to content

Commit d4b0b20

Browse files
authored
Merge pull request #15 from prog-time/issues-12
fixed README.md
2 parents f9f0fbe + 862159d commit d4b0b20

2 files changed

Lines changed: 149 additions & 4 deletions

File tree

CLAUDE.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,81 @@
22

33
## Project Overview
44

5-
A collection of reusable git hook scripts for automating code quality checks. Main focus: PHP/Laravel (PHPStan, Pint), shell script validation (ShellCheck), Docker linting, and commit message enhancement.
5+
A collection of reusable git hook scripts for automating code quality checks. Covers JavaScript/TypeScript, Python, PHP/Laravel, CSS, HTML, Markdown, YAML, Docker, and shell scripts.
66

77
## Directory Structure
88

99
```
10+
css/ # CSS/SCSS/Less hooks
11+
├── check_stylelint.sh # Stylelint for staged files
12+
└── check_stylelint_all.sh # Stylelint for entire project
13+
1014
docker/ # Docker-related hooks
11-
── check_hadolint.sh # Dockerfile linter
15+
── check_hadolint.sh # Dockerfile linter
1216
1317
git/ # Git workflow hooks
1418
├── check_branch_name.sh # Branch naming convention validator
1519
└── preparations/ # Commit message enhancers
1620
├── add_task_id_in_commit.sh
1721
└── prepare-commit-description.sh
1822
23+
html/ # HTML hooks
24+
├── check_htmlhint.sh # HTMLHint for staged files
25+
└── check_htmlhint_all.sh # HTMLHint for entire project
26+
27+
javascript/ # JavaScript/TypeScript hooks
28+
├── check_eslint_all.sh # ESLint across the project
29+
├── check_prettier.sh # Prettier on staged files
30+
├── check_prettier_all.sh # Prettier on all TS files
31+
├── check_tsc_all.sh # TypeScript type checking
32+
├── check_vitest.sh # Vitest runner
33+
├── check_vitest_all.sh # Full Vitest suite
34+
├── check_tests.sh # Vitest for changed files
35+
├── check_tests_all.sh # Full Vitest suite (wrapper)
36+
├── check_test_coverage.sh # Vitest with coverage
37+
└── check_tests_exist.sh # Test file existence validator
38+
39+
markdown/ # Markdown hooks
40+
├── check_markdownlint.sh # markdownlint for staged files
41+
└── check_markdownlint_all.sh # markdownlint for entire project
42+
1943
php/ # PHP/Laravel hooks
2044
├── check_phpstan.sh # PHPStan with progressive error reduction
2145
├── find_test.sh # Unit test coverage validator
2246
├── start_test_in_docker.sh # Run PHPUnit tests in Docker
2347
└── laravel/
2448
└── check_pint.sh # Laravel Pint code style fixer
2549
50+
python/ # Python hooks
51+
├── check_flake8.sh # Flake8 linting (local)
52+
├── check_flake8_in_docker.sh # Flake8 (Docker)
53+
├── check_mypy.sh # Mypy type checking (local)
54+
├── check_mypy_in_docker.sh # Mypy (Docker)
55+
├── check_pytest.sh # Pytest (local)
56+
├── check_pytest_in_docker.sh # Pytest (Docker)
57+
└── find_test.sh # Service test existence validator
58+
2659
shell/ # Shell script validation
2760
└── check_shellcheck.sh # ShellCheck via Docker
2861
2962
scripts/ # Local utility scripts
3063
├── check_shellcheck.sh # ShellCheck (local execution)
3164
└── pre-commit-check.sh # Pre-commit orchestrator
3265
66+
yml/ # YAML hooks
67+
├── check_yamllint.sh # yamllint for staged files
68+
└── check_yamllint_all.sh # yamllint for entire project
69+
3370
tests/ # Test framework
3471
├── run_all.sh # Run all test suites
3572
├── lib/test_helper.bash # Test utilities and assertions
36-
└── php/phpstan/ # PHPStan hook tests
73+
├── css/ # CSS hook tests
74+
├── html/ # HTML hook tests
75+
├── javascript/ # JavaScript hook tests
76+
├── markdown/ # Markdown hook tests
77+
├── php/ # PHP hook tests
78+
├── python/ # Python hook tests
79+
└── yml/ # YAML hook tests
3780
```
3881

3982
## Script Conventions
@@ -67,7 +110,13 @@ Every script must start with a description block after the shebang:
67110
## Dependencies
68111

69112
- Bash 4.0+, Git, jq
113+
- Node.js with npx (for JavaScript/TypeScript, CSS, HTML hooks)
114+
- Python 3, Flake8, Mypy, Pytest (for Python hooks)
70115
- PHP 8.1+, Composer (for PHPStan/Pint)
116+
- Stylelint via npx (for CSS hooks)
117+
- HTMLHint via npx (for HTML hooks)
118+
- markdownlint-cli (for Markdown hooks)
119+
- yamllint (for YAML hooks)
71120
- Docker (optional, for containerized checks)
72121
- ShellCheck (for shell validation)
73122

README.md

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ A collection of reusable git hook scripts for automating code quality checks and
77
- **JavaScript/TypeScript**: ESLint, Prettier, TypeScript type checking, Vitest test runner, test existence validation
88
- **Python**: Flake8 linting, Mypy static analysis, Pytest runner, service test validation (local and Docker modes)
99
- **PHP/Laravel**: PHPStan analysis with progressive error reduction, Pint code style fixing, test coverage validation
10+
- **CSS/SCSS/Less**: Stylelint code style validation
11+
- **HTML**: HTMLHint linting
12+
- **Markdown**: markdownlint style validation
13+
- **YAML**: yamllint style validation
1014
- **Docker**: Dockerfile linting with Hadolint
1115
- **Shell**: Script validation with ShellCheck
1216
- **Git**: Branch naming conventions, automatic task ID injection in commits
@@ -55,6 +59,34 @@ A collection of reusable git hook scripts for automating code quality checks and
5559
| `php/find_test.sh` | Validates that modified PHP classes have corresponding unit tests. |
5660
| `php/start_test_in_docker.sh` | Runs PHPUnit tests inside Docker for modified files. |
5761

62+
### CSS / SCSS / Less
63+
64+
| Script | Description |
65+
|--------|-------------|
66+
| `css/check_stylelint.sh` | Runs Stylelint on staged CSS/SCSS/Less files passed as arguments. |
67+
| `css/check_stylelint_all.sh` | Runs Stylelint on all CSS/SCSS/Less files in the project. Used in pre-push hooks. |
68+
69+
### HTML
70+
71+
| Script | Description |
72+
|--------|-------------|
73+
| `html/check_htmlhint.sh` | Runs HTMLHint on staged HTML files passed as arguments. |
74+
| `html/check_htmlhint_all.sh` | Runs HTMLHint on all HTML files in the project. Used in pre-push hooks. |
75+
76+
### Markdown
77+
78+
| Script | Description |
79+
|--------|-------------|
80+
| `markdown/check_markdownlint.sh` | Runs markdownlint on staged `.md` files passed as arguments. |
81+
| `markdown/check_markdownlint_all.sh` | Runs markdownlint on all `.md` files in the project. Used in pre-push hooks. |
82+
83+
### YAML
84+
85+
| Script | Description |
86+
|--------|-------------|
87+
| `yml/check_yamllint.sh` | Runs yamllint on staged `.yml`/`.yaml` files passed as arguments. |
88+
| `yml/check_yamllint_all.sh` | Runs yamllint on all `.yml`/`.yaml` files in the project. Used in pre-push hooks. |
89+
5890
### Git Workflow
5991

6092
| Script | Description |
@@ -138,6 +170,46 @@ A collection of reusable git hook scripts for automating code quality checks and
138170
./php/check_phpstan.sh strict src/Service.php
139171
```
140172

173+
### CSS / SCSS / Less
174+
175+
```bash
176+
# Check staged files
177+
./css/check_stylelint.sh styles/main.css components/button.scss
178+
179+
# Check all files in the project
180+
./css/check_stylelint_all.sh
181+
```
182+
183+
### HTML
184+
185+
```bash
186+
# Check staged files
187+
./html/check_htmlhint.sh templates/index.html templates/layout.html
188+
189+
# Check all files in the project
190+
./html/check_htmlhint_all.sh
191+
```
192+
193+
### Markdown
194+
195+
```bash
196+
# Check staged files
197+
./markdown/check_markdownlint.sh README.md docs/guide.md
198+
199+
# Check all files in the project
200+
./markdown/check_markdownlint_all.sh
201+
```
202+
203+
### YAML
204+
205+
```bash
206+
# Check staged files
207+
./yml/check_yamllint.sh .github/workflows/ci.yml docker-compose.yml
208+
209+
# Check all files in the project
210+
./yml/check_yamllint_all.sh
211+
```
212+
141213
### Branch Name Validation
142214

143215
```bash
@@ -188,6 +260,18 @@ bash python/find_test.sh $FILES
188260
PHP_FILES=$(echo "$FILES" | grep '\.php$' || true)
189261
[[ -n "$PHP_FILES" ]] && bash php/check_phpstan.sh default $PHP_FILES
190262

263+
# CSS/SCSS/Less
264+
bash css/check_stylelint.sh $FILES
265+
266+
# HTML
267+
bash html/check_htmlhint.sh $FILES
268+
269+
# Markdown
270+
bash markdown/check_markdownlint.sh $FILES
271+
272+
# YAML
273+
bash yml/check_yamllint.sh $FILES
274+
191275
# Shell
192276
SH_FILES=$(echo "$FILES" | grep '\.sh$' || true)
193277
[[ -n "$SH_FILES" ]] && bash scripts/check_shellcheck.sh $SH_FILES
@@ -207,16 +291,28 @@ SH_FILES=$(echo "$FILES" | grep '\.sh$' || true)
207291
./tests/python/flake8/run.sh
208292
./tests/python/mypy/run.sh
209293
./tests/python/find_test/run.sh
294+
./tests/css/stylelint/run.sh
295+
./tests/css/stylelint_all/run.sh
296+
./tests/html/htmlhint/run.sh
297+
./tests/html/htmlhint_all/run.sh
298+
./tests/markdown/markdownlint/run.sh
299+
./tests/markdown/markdownlint_all/run.sh
300+
./tests/yml/yamllint/run.sh
301+
./tests/yml/yamllint_all/run.sh
210302
```
211303

212304
## Requirements
213305

214306
- Bash 4.0+
215307
- Git
216308
- jq
217-
- Node.js with npx (for JavaScript/TypeScript hooks)
309+
- Node.js with npx (for JavaScript/TypeScript, CSS, HTML hooks)
218310
- Python 3, Flake8, Mypy, Pytest (for Python hooks)
219311
- PHP 8.1+ with Composer (for PHP hooks)
312+
- Stylelint (`npm install -g stylelint`) or via `npx`
313+
- HTMLHint (`npm install -g htmlhint`) or via `npx`
314+
- markdownlint-cli (`npm install -g markdownlint-cli`)
315+
- yamllint (`pip install yamllint` or system package)
220316
- Docker (optional, for Docker-based hooks)
221317
- ShellCheck (for shell validation)
222318

0 commit comments

Comments
 (0)