Centralized code quality and linting tools for the entire Pyrrha Platform. This repository provides unified formatting, linting, and code quality enforcement across all Pyrrha repositories.
- Unified Standards: Consistent code style across JavaScript, Python, and other languages
- Multi-Repository Support: Single command to lint all Pyrrha repositories
- Technology-Aware: Automatically detects and applies appropriate tools (React, Flask, Node.js, etc.)
- CI/CD Ready: Easy integration with GitHub Actions and other automation
- Git Integration: Pre-commit hooks ensure code quality before commits
# 1. Navigate to the tools repository
cd /Users/krook/dev/Pyrrha/Pyrrha-Development-Tools
# 2. Install dependencies
npm run setup
# 3. Check workspace health
npm run check:workspace
# 4. Lint all repositories
npm run lint:all
# 5. Fix all auto-fixable issues
npm run format:all
# 6. Install Git pre-commit hooks (optional)
npm run setup:hooks# Lint all repositories
npm run lint:all
# Lint specific repositories
node scripts/lint-all.js --repo=Pyrrha-Dashboard
node scripts/lint-all.js --repo=Pyrrha-Dashboard,Pyrrha-MQTT-Client
# Verbose output
npm run lint:all -- --verbose# Fix all auto-fixable issues across all repos
npm run format:all
# Fix specific repositories
npm run format:dashboard
npm run format:python
npm run format:nodejs
npm run format:cpp# Install all dependencies (Node.js + Python)
npm run setup
# Install Git pre-commit hooks
npm run setup:hooks
# Check workspace structure and health
npm run check:workspace| Repository | Languages | Tools Applied |
|---|---|---|
| Pyrrha-Dashboard | JavaScript, Python | Prettier, ESLint, Black, isort, flake8, mypy |
| Pyrrha-MQTT-Client | JavaScript | Prettier, ESLint |
| Pyrrha-Rules-Decision | Python | Black, isort, flake8, mypy, bandit, safety |
| Pyrrha-WebSocket-Server | JavaScript | Prettier, ESLint |
| Pyrrha-Device-Simulator | JavaScript | Prettier, ESLint |
| Pyrrha-Website | JavaScript (React) | Prettier, ESLint + React rules |
| Pyrrha-Watch-App | JavaScript | Prettier, ESLint |
| Pyrrha-Firmware | C/C++ (Arduino) | clang-format, static analysis |
configs/.prettierrc.js- Prettier formatting rules (from proven Dashboard config)configs/eslint.config.js- ESLint JavaScript/React rulesconfigs/pyproject.toml- Python tools configuration (from Rules-Decision workflow)configs/.clang-format- C/C++/Arduino formatting rules
scripts/lint-dashboard.sh- Multi-stack Dashboard (React + Flask + Node.js Auth)scripts/lint-python.sh- Python repositories with comprehensive toolingscripts/lint-nodejs.sh- Node.js repositories with React detectionscripts/lint-all.js- Main orchestration script
- Prettier: Code formatting
- ESLint: Linting with React, Jest, and Testing Library plugins
- Testing: Automated test running where configured
- Black: Code formatting
- isort: Import sorting
- flake8: Style guide enforcement
- mypy: Type checking
- bandit: Security linting
- safety: Dependency vulnerability scanning
- clang-format: Code formatting
- Static analysis: Common Arduino/embedded patterns
- Project structure: Arduino-specific checks
- dockerfilelint: Dockerfile best practices
- Pre-commit hooks: Automatic linting before commits
- Repository detection: Workspace-aware linting
cd Pyrrha-Development-Tools
npm run lint:allnpm run format:dashboardnode scripts/lint-all.js --repo=Pyrrha-Rules-Decisionnpm run check:workspacenpm run setup:hooksAfter running npm run setup:hooks, every Git commit in any Pyrrha repository will:
- β Auto-detect the repository type
- π Run appropriate linting (JavaScript, Python, etc.)
- β Block the commit if linting fails
- π‘ Provide fix suggestions
To bypass hooks for emergency commits:
git commit --no-verify- Semi-colons: Required
- Quotes: Single quotes preferred
- Line Length: 80 characters
- Trailing Commas: ES5 style
- React: Latest hooks and best practices
- Line Length: 88 characters (Black default)
- Import Sorting: Black-compatible isort profile
- Type Hints: Encouraged but not required
- Security: Bandit security scanning enabled
Ready-to-use workflow templates are provided in templates/:
github-workflow-dashboard.yml- Multi-stack Dashboard linting (matches current workflow)github-workflow-python.yml- Python repositories (matches Rules-Decision workflow)github-workflow-cpp.yml- C/C++/Arduino firmware lintinggithub-workflow-centralized.yml- Uses this centralized tooling system
The templates match the existing proven workflows:
Dashboard: Line length 127 for Python (Black), proven Prettier config, multi-API support
Rules-Decision: Python 3.11, comprehensive security scanning (bandit, safety)
Firmware: Arduino-aware linting, clang-format integration
- Keep existing workflows - They're proven and working
- Use centralized tools locally - For development and consistency
- Gradually adopt templates - For new repositories or major updates
- name: Centralized Linting
run: |
cd Pyrrha-Development-Tools
npm install && pip install -r requirements.txt
npm run lint:all"Command not found" errors:
# Ensure all dependencies are installed
npm run setupPython virtual environment issues:
# Dashboard Flask API setup
cd Pyrrha-Dashboard/pyrrha-dashboard/api-main
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtGit hooks not working:
# Reinstall hooks
npm run setup:hooks
# Check hook permissions
chmod +x .git/hooks/pre-commit# See detailed output
node scripts/lint-all.js --verbose
# Check individual repository
cd Pyrrha-Dashboard
../Pyrrha-Development-Tools/scripts/lint-dashboard.sh --fix- Java/Android: Linting support for Pyrrha-Mobile-App
- Hardware Documentation: Markdown/documentation linting for hardware repos
- Performance Monitoring: Linting performance metrics and reporting
- IDE Integration: VS Code extension for real-time linting
- Custom Rules: Pyrrha-specific ESLint and flake8 rules
- Add New Repository Support: Update
REPO_CONFIGSinscripts/lint-all.js - Modify Linting Rules: Edit configuration files in
configs/ - Create New Scripts: Add technology-specific scripts in
scripts/ - Test Changes: Run
npm run check:workspaceandnpm run lint:all
Apache 2.0 - See individual repository licenses for specific terms.
Pyrrha Platform - Firefighter Safety Through Technology
π Platform Overview β’ π
Deployment Guide# Pyrrha-Development-Tools