Skip to content

Commit daa9e7f

Browse files
committed
fix pre-commit issues: exclude ts configs from json check, add B603,B607 to bandit skips
0 parents  commit daa9e7f

107 files changed

Lines changed: 28725 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Python Linting & Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- '**.py'
8+
- 'pyproject.toml'
9+
- 'requirements*.txt'
10+
- '.github/workflows/lint.yml'
11+
pull_request:
12+
branches: [ main, develop ]
13+
paths:
14+
- '**.py'
15+
- 'pyproject.toml'
16+
- 'requirements*.txt'
17+
- '.github/workflows/lint.yml'
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: ["3.10", "3.11", "3.12"]
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v3
37+
with:
38+
enable-cache: true
39+
40+
- name: Install dependencies
41+
run: |
42+
uv sync --all-extras --dev
43+
44+
- name: Run Ruff Linter
45+
run: |
46+
uv run ruff check trackstudio/ --output-format=github
47+
48+
- name: Run Ruff Formatter Check
49+
run: |
50+
uv run ruff format trackstudio/ --check
51+
52+
security:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Python
59+
uses: actions/setup-python@v4
60+
with:
61+
python-version: "3.11"
62+
63+
- name: Install uv
64+
uses: astral-sh/setup-uv@v3
65+
66+
- name: Install dependencies
67+
run: |
68+
uv sync --all-extras --dev
69+
70+
- name: Run Bandit Security Linter
71+
run: |
72+
uv run bandit -r trackstudio/ -f json -o bandit-report.json
73+
continue-on-error: true
74+
75+
- name: Upload Bandit Report
76+
uses: actions/upload-artifact@v4
77+
if: always()
78+
with:
79+
name: bandit-security-report
80+
path: bandit-report.json

.gitignore

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
**/node_modules/
2+
.env
3+
.env.local
4+
.env.development.local
5+
.env.test.local
6+
.env.production.local
7+
.env.development
8+
.env.test
9+
.env.production
10+
**/__pycache__/
11+
tests/videos/*.mp4
12+
**/*.log
13+
**/dist/
14+
**/build/
15+
**.pth
16+
**/*.pth
17+
**/*.pkl
18+
**/*.ptl
19+
**/*.pthl
20+
**/*.pkl
21+
**/*.ptl
22+
**/*.pthl
23+
24+
# Byte-compiled / optimized / DLL files
25+
__pycache__/
26+
*.py[cod]
27+
*$py.class
28+
29+
# C extensions
30+
*.so
31+
32+
# Distribution / packaging
33+
.Python
34+
build/
35+
develop-eggs/
36+
dist/
37+
downloads/
38+
eggs/
39+
.eggs/
40+
lib/
41+
lib64/
42+
parts/
43+
sdist/
44+
var/
45+
wheels/
46+
share/python-wheels/
47+
*.egg-info/
48+
.installed.cfg
49+
*.egg
50+
MANIFEST
51+
52+
# PyInstaller
53+
*.manifest
54+
*.spec
55+
56+
# Installer logs
57+
pip-log.txt
58+
pip-delete-this-directory.txt
59+
60+
# Unit test / coverage reports
61+
htmlcov/
62+
.tox/
63+
.nox/
64+
.coverage
65+
.coverage.*
66+
.cache
67+
nosetests.xml
68+
coverage.xml
69+
*.cover
70+
*.py,cover
71+
.hypothesis/
72+
.pytest_cache/
73+
cover/
74+
75+
# Virtual environments
76+
.env
77+
.venv
78+
env/
79+
venv/
80+
ENV/
81+
env.bak/
82+
venv.bak/
83+
84+
# IDEs
85+
.vscode/
86+
.idea/
87+
*.swp
88+
*.swo
89+
*~
90+
.DS_Store
91+
92+
# Project specific
93+
calibration_data.json
94+
*.pth
95+
*.onnx
96+
*.pt
97+
*.weights
98+
logs/
99+
100+
# Node modules (for React frontend)
101+
node_modules/
102+
web/dist/
103+
web/build/
104+
105+
# TrackStudio static files (built from React)
106+
trackstudio/static/*
107+
!trackstudio/static/.gitkeep
108+
109+
# Documentation
110+
docs/_build/
111+
docs/_static/
112+
docs/_templates/
113+
114+
# mypy
115+
.mypy_cache/
116+
.dmypy.json
117+
dmypy.json

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-toml
9+
- id: check-json
10+
exclude: ^web/tsconfig\.(app|node)\.json$
11+
- id: check-merge-conflict
12+
- id: check-added-large-files
13+
args: ['--maxkb=15360']
14+
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.6.8
17+
hooks:
18+
- id: ruff
19+
args: [--fix, --exit-non-zero-on-fix]
20+
types_or: [python, pyi]
21+
- id: ruff-format
22+
types_or: [python, pyi]
23+
24+
# - repo: https://github.com/pre-commit/mirrors-mypy
25+
# rev: v1.8.0
26+
# hooks:
27+
# - id: mypy
28+
# args: [--ignore-missing-imports, --show-error-codes]
29+
# additional_dependencies: [types-requests]
30+
# exclude: ^(tests/|docs/|trackstudio/static/)
31+
32+
- repo: https://github.com/PyCQA/bandit
33+
rev: 1.7.5
34+
hooks:
35+
- id: bandit
36+
args: [-c, pyproject.toml]
37+
additional_dependencies: ["bandit[toml]"]
38+
exclude: ^tests/

0 commit comments

Comments
 (0)