From 1893c2af1bce2c7814e3ecbeb1ccdc4f2a57a3e5 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Tue, 26 Aug 2025 04:32:32 +0000 Subject: [PATCH] fix: downgrade commitlint strict rules to warnings - Move commitlint config from package.json to dedicated file - Change subject-case and subject-full-stop rules from errors to warnings - Eliminates red error messages on push while maintaining guidance - Maintains conventional commit standards with non-blocking feedback - Update BUILDING.md with comprehensive changelog entry --- BUILDING.md | 27 +++++++++++++++++++++++++++ commitlint.config.js | 9 +++++++++ package.json | 6 +----- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 commitlint.config.js diff --git a/BUILDING.md b/BUILDING.md index a1bb026e..ba981a8d 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -2716,6 +2716,33 @@ configuration files in the repository. --- +### 2025-08-21 - Commitlint Configuration Refinement + +#### Commit Message Validation Improvements +- **Modified**: Commitlint configuration moved from `package.json` to dedicated `commitlint.config.js` +- **Enhanced**: Strict validation rules downgraded from errors to warnings + - **Before**: `subject-case` and `subject-full-stop` rules caused red error messages + - **After**: Same rules now show yellow warnings without blocking commits +- **Benefit**: Eliminates confusing red error messages while maintaining commit quality guidance + +#### Configuration Structure +- **File**: `commitlint.config.js` - Dedicated commitlint configuration +- **Extends**: `@commitlint/config-conventional` - Standard conventional commit rules +- **Custom Rules**: + - `subject-case: [1, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']]` + - `subject-full-stop: [1, 'never', '.']` +- **Levels**: + - `0` = Disabled, `1` = Warning, `2` = Error + - Current: Problematic rules set to warning level (1) + +#### User Experience Impact +- **Before**: Red error messages on every push with strict commit rules +- **After**: Yellow warning messages that provide guidance without disruption +- **Workflow**: Commits and pushes continue to work while maintaining quality standards +- **Feedback**: Developers still receive helpful commit message guidance + +--- + **Note**: This documentation is maintained alongside the build system. For the most up-to-date information, refer to the actual script files and Vite configuration files in the repository. diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..89dec502 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,9 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + // Downgrade strict case rules to warnings (level 1) instead of errors (level 2) + // This eliminates red error messages while maintaining helpful guidance + 'subject-case': [1, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']], + 'subject-full-stop': [1, 'never', '.'], + } +}; diff --git a/package.json b/package.json index 78226938..d3b86aa3 100644 --- a/package.json +++ b/package.json @@ -136,11 +136,7 @@ "*.{js,ts,vue,css,json,yml,yaml}": "eslint --fix || true", "*.{md,markdown,mdc}": "markdownlint-cli2 --fix" }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, + "dependencies": { "@capacitor-community/electron": "^5.0.1", "@capacitor-community/sqlite": "6.0.2",