|
| 1 | +# GitHub Workflows Configuration |
| 2 | + |
| 3 | +This project includes multiple workflow options for code style checking. Choose the approach that best fits your team's needs. |
| 4 | + |
| 5 | +## Code Style Workflows |
| 6 | + |
| 7 | +### Option 1: Strict Mode (Current) |
| 8 | +**File**: `.github/workflows/code-style.yml` |
| 9 | + |
| 10 | +**Behavior**: |
| 11 | +- ❌ Fails CI if code style issues are found |
| 12 | +- 🛑 Requires manual fixing before merge |
| 13 | +- 📋 Shows exactly what needs to be fixed |
| 14 | + |
| 15 | +**Best for**: |
| 16 | +- Open source projects |
| 17 | +- Teams focused on code quality education |
| 18 | +- Projects where every commit should be intentional |
| 19 | + |
| 20 | +**Usage**: Already active in `ci.yml` |
| 21 | + |
| 22 | +### Option 2: Auto-fix Mode |
| 23 | +**File**: `.github/workflows/code-style-fix.yml` |
| 24 | + |
| 25 | +**Behavior**: |
| 26 | +- 🤖 Automatically fixes code style issues |
| 27 | +- 📝 Commits fixes with "Fix coding style issues with Pint 🤖" |
| 28 | +- ✅ Never blocks CI for style issues |
| 29 | + |
| 30 | +**Best for**: |
| 31 | +- Private repositories |
| 32 | +- Teams prioritizing speed over strict processes |
| 33 | +- Projects with trusted contributors only |
| 34 | + |
| 35 | +**Usage**: Uncomment in `ci.yml` and comment strict mode |
| 36 | + |
| 37 | +## How to Switch |
| 38 | + |
| 39 | +### To Auto-fix Mode: |
| 40 | + |
| 41 | +1. Edit `.github/workflows/ci.yml`: |
| 42 | +```yaml |
| 43 | +jobs: |
| 44 | + tests: |
| 45 | + uses: ./.github/workflows/tests.yml |
| 46 | + |
| 47 | + # Option 1: Strict mode (fails CI if code style issues found) |
| 48 | + # code-style: |
| 49 | + # uses: ./.github/workflows/code-style.yml |
| 50 | + |
| 51 | + # Option 2: Auto-fix mode (automatically commits style fixes) |
| 52 | + code-style-fix: |
| 53 | + uses: ./.github/workflows/code-style-fix.yml |
| 54 | + |
| 55 | + static-analysis: |
| 56 | + uses: ./.github/workflows/static-analysis.yml |
| 57 | + |
| 58 | + quality-gate: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + needs: [tests, code-style-fix, static-analysis] |
| 61 | + # ... rest of the config |
| 62 | +``` |
| 63 | + |
| 64 | +2. Optional: Delete `.github/workflows/code-style.yml` if not needed |
| 65 | + |
| 66 | +### To Strict Mode: |
| 67 | +Current configuration (no changes needed) |
| 68 | + |
| 69 | +## Recommendation |
| 70 | + |
| 71 | +For this **public package**, we recommend **Strict Mode** because: |
| 72 | +- 🎯 Enforces quality standards |
| 73 | +- 📚 Educates contributors |
| 74 | +- 🔒 Prevents accidental style violations |
| 75 | +- 🧹 Keeps git history clean |
| 76 | + |
| 77 | +Consider Auto-fix Mode only for: |
| 78 | +- Private team repositories |
| 79 | +- Rapid prototyping phases |
| 80 | +- Teams with established trust and processes |
0 commit comments