Skip to content

Commit fa617f1

Browse files
authored
Add pre-commit hooks (#13)
Signed-off-by: David Butenhof <dbutenho@redhat.com>
1 parent fe54ddf commit fa617f1

File tree

13 files changed

+70
-25
lines changed

13 files changed

+70
-25
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
ignore = E203,E226,E501,W503,E701,E704

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
exclude: ^tests/?.*/assets/.+
7+
- id: end-of-file-fixer
8+
exclude: ^tests/?.*/assets/.+
9+
- repo: https://github.com/hukkin/mdformat
10+
rev: 1.0.0
11+
hooks:
12+
- id: mdformat
13+
name: run markdown formatter
14+
exclude: ^\.github/.+
15+
additional_dependencies:
16+
- "mdformat-footnote~=0.1.3"
17+
- "mdformat-frontmatter~=2.0.10"
18+
- "mdformat-gfm~=1.0.0"
19+
- repo: https://github.com/astral-sh/uv-pre-commit
20+
rev: 0.9.15
21+
hooks:
22+
- id: uv-lock
23+
name: check uv.lock file matches pyproject
24+
args: [--project, backend]
25+
- repo: https://github.com/psf/black
26+
rev: 26.3.1 # Use the latest stable version
27+
hooks:
28+
- id: black
29+
name: black (python)
30+
# Optional: Specify target python version
31+
language_version: python3.12
32+
- repo: https://github.com/pycqa/isort
33+
rev: 8.0.1 # Use the latest version from isort's GitHub
34+
hooks:
35+
- id: isort
36+
name: isort (python)
37+
- repo: https://github.com/PyCQA/flake8
38+
rev: 7.3.0
39+
hooks:
40+
- id: flake8
41+
name: flake8 (python)

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# github_pm
2+
23
A tool to help with project management using GitHub issues, PRs, milestones, labels
34

45
## Overview
@@ -7,7 +8,7 @@ A tool to help with project management using GitHub issues, PRs, milestones, lab
78

89
This project provides a backend API (FastAPI) and a frontend web UI for seamless and organized project management, all with modern best practices.
910

10-
---
11+
______________________________________________________________________
1112

1213
## Features
1314

@@ -17,7 +18,7 @@ This project provides a backend API (FastAPI) and a frontend web UI for seamless
1718
- Easy-to-use web interface (frontend)
1819
- Powerful RESTful API (backend)
1920

20-
---
21+
______________________________________________________________________
2122

2223
## Getting Started
2324

@@ -72,7 +73,7 @@ and then you can terminate with 'kill-pm'
7273
alias kill-pm="kill -- - 49613"
7374
```
7475

75-
---
76+
______________________________________________________________________
7677

7778
## Usage
7879

@@ -102,25 +103,25 @@ select and reorder from the "Sort" pulldown at the top of the page. For example,
102103
you can show "bugs" first, or "high priority" followed by "medium priority"
103104
followed by "low priority".
104105

105-
---
106+
______________________________________________________________________
106107

107108
## Development
108109

109110
### Linting & Formatting
110111

111-
- **Backend:**
112+
- **Backend:**
112113
- Lint: `uv run flake8 src tests`
113114
- Format: `uv run black --check src tests`
114115
- Import Sort: `uv run isort --check src tests`
115-
- **Frontend:**
116+
- **Frontend:**
116117
- Format: `npm run format:check`
117118
- Lint: (add your preferred lint command)
118119

119120
### Testing
120121

121-
- **Backend:**
122+
- **Backend:**
122123
- Run tests (add your test framework/command here)
123-
- **Frontend:**
124+
- **Frontend:**
124125
- Run tests: `npm test -- --run`
125126

126127
### Continuous Integration
@@ -130,31 +131,30 @@ GitHub Actions are set up for linting, formatting, and testing on pull requests
130131
- Backend: Python linting, formatting, dependency install via [uv](https://github.com/astral-sh/uv)
131132
- Frontend: Node linting, formatting, and tests
132133

133-
---
134+
______________________________________________________________________
134135

135136
## Configuration
136137

137138
- Edit your backend configuration and package dependencies in `backend/pyproject.toml`
138139
- Customize Flake8 with `.flake8` in the backend directory
139140

140-
---
141+
______________________________________________________________________
141142

142143
## Contributing
143144

144-
Issues and pull requests are welcome!
145+
Issues and pull requests are welcome!
145146
See [CONTRIBUTING.md](CONTRIBUTING.md) (if available) or open an issue for any questions or suggestions.
146147

147-
---
148+
______________________________________________________________________
148149

149150
## License
150151

151152
[Apache License 2.0](LICENSE)
152153

153-
---
154+
______________________________________________________________________
154155

155156
## Links
156157

157158
- **Homepage & Docs:** [https://github.com/dbutenhof/github-pm](https://github.com/dbutenhof/github-pm)
158159
- **Repository:** [https://github.com/dbutenhof/github-pm](https://github.com/dbutenhof/github-pm)
159160
- **Report Issues:** [https://github.com/dbutenhof/github-pm/issues](https://github.com/dbutenhof/github-pm/issues)
160-

backend/.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.gitignore
1+
.gitignore

backend/backend.containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ COPY pyproject.toml uv.lock ./
3535
RUN uv sync -vvv --no-root --no-interaction --no-ansi
3636

3737
# Ensure generated cache and config files are group-writable
38-
# for both OpenShift (random UID in GID=0) and Podman (root)
38+
# for both OpenShift (random UID in GID=0) and Podman (root)
3939
# environments
4040
RUN chmod -R g+rwX ${HOME}/.venv
4141

frontend/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ dist
55
.env
66
.env.local
77
coverage
8-

frontend/.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ coverage
44
*.lock
55
package-lock.json
66
build
7-

frontend/.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88
"arrowParens": "always",
99
"endOfLine": "lf"
1010
}
11-

frontend/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ A React application built with Patternfly for managing GitHub project milestones
1515
## Setup
1616

1717
1. Install dependencies:
18+
1819
```bash
1920
npm install
2021
```
2122

2223
2. Start the development server:
24+
2325
```bash
2426
npm run dev
2527
```
@@ -29,35 +31,41 @@ The application will be available at `http://localhost:3000`.
2931
## Build
3032

3133
To build for production:
34+
3235
```bash
3336
npm run build
3437
```
3538

3639
## Testing
3740

3841
Run tests:
42+
3943
```bash
4044
npm test
4145
```
4246

4347
Run tests with UI:
48+
4449
```bash
4550
npm run test:ui
4651
```
4752

4853
Run tests with coverage:
54+
4955
```bash
5056
npm run test:coverage
5157
```
5258

5359
## Code Formatting
5460

5561
Format all code with Prettier:
62+
5663
```bash
5764
npm run format
5865
```
5966

6067
Check if code is formatted correctly:
68+
6169
```bash
6270
npm run format:check
6371
```
@@ -105,4 +113,3 @@ frontend/
105113
- React Testing Library
106114
- React Markdown for rendering issue descriptions
107115
- Prettier for code formatting
108-

0 commit comments

Comments
 (0)