{"_id":"@ahub-public/commitlint-config","_rev":"2-7929905d5eb3d23471992e54ce55ed43","name":"@ahub-public/commitlint-config","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@ahub-public/commitlint-config","version":"1.0.0","license":"MIT","_id":"@ahub-public/commitlint-config@1.0.0","maintainers":[{"name":"sriprasanna.mg","email":"sriprasanna.mg@br-automation.com"}],"dist":{"shasum":"83d0f918888dad0225ef0c81dc566213e59f03c5","tarball":"https://registry.npmjs.org/@ahub-public/commitlint-config/-/commitlint-config-1.0.0.tgz","fileCount":4,"integrity":"sha512-3vu6qvxj2NuT+2CybbpHyDJ5UWIiA1Gcp+2Xa2GhvWQNV8ajEMCfD20Bzh4B85rPdA/ZJviBHK7opoLKFHKRiA==","signatures":[{"sig":"MEUCIBwvUtK91yGf1zWndFfbY+Zu8jPjB86msi50jRXviy/PAiEAl5kEd1uiZH4xS2ylYo8k3gwZr1LqwfY/e69ieP8tluY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1152},"main":"commitlint.config.js","gitHead":"b0c1a1eb3d57841a381a5c2608922ff6a019d26f","_npmUser":{"name":"sriprasanna.mg","email":"sriprasanna.mg@br-automation.com"},"_npmVersion":"10.8.2","description":"Automation hub repository holding lint configuration files in order to keep it centralized for CI and IDEs","directories":{},"_nodeVersion":"20.18.3","dependencies":{"@commitlint/config-conventional":"^17.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/commitlint-config_1.0.0_1740667051883_0.9729697953860919","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ahub-public/commitlint-config","version":"1.1.0","main":"commitlint.config.js","publishConfig":{"access":"public"},"license":"MIT","dependencies":{"@commitlint/config-conventional":"^20.5.0"},"_id":"@ahub-public/commitlint-config@1.1.0","gitHead":"aea57594dbb710f0def15a483d624182c3205202","description":"A centralized repository for Automation Hub lint configurations, ensuring consistent commit message conventions and linting rules across multiple projects and CI systems. Lint configs are published as a public npm package so that they can be easily used i","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-EU4k1u3Bs+nI2QCoQ83ESYLKzEiMZCWV6OIsNtsoOSRZk1QIec7i27fy0HXzu/aUJtMUE9+JVoo6dzg+OuJ+Pw==","shasum":"c9fd753e1648962a81b98c277b448c72df92a2b2","tarball":"https://registry.npmjs.org/@ahub-public/commitlint-config/-/commitlint-config-1.1.0.tgz","fileCount":4,"unpackedSize":5089,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDa4jmxJmd/2mI/DqBnUJ7IpP9E/c94zE39fOmteaAB9AiEA2tBoX3ekkRuur/hTialFYAcubgPR0sXNJU7TNlW/sTE="}]},"_npmUser":{"name":"sriprasanna.mg","email":"sriprasanna.mg@br-automation.com"},"directories":{},"maintainers":[{"name":"sriprasanna.mg","email":"sriprasanna.mg@br-automation.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commitlint-config_1.1.0_1776413927256_0.6046699756836369"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-27T14:37:31.818Z","modified":"2026-04-17T08:18:47.547Z","1.0.0":"2025-02-27T14:37:32.063Z","1.1.0":"2026-04-17T08:18:47.436Z"},"license":"MIT","description":"A centralized repository for Automation Hub lint configurations, ensuring consistent commit message conventions and linting rules across multiple projects and CI systems. Lint configs are published as a public npm package so that they can be easily used i","maintainers":[{"name":"sriprasanna.mg","email":"sriprasanna.mg@br-automation.com"}],"readme":"# ahub-lint-config\n\nA centralized repository for Automation Hub lint configurations, ensuring consistent commit message conventions and linting rules across multiple projects and CI systems. Lint configs are published as a public npm package so that they can be easily used in both CI pipelines and local development setups.\n\n---\n\n## Conventional Commits Linter\n\n**Goal**: Enforce [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) to keep commit messages organized and meaningful.\n\n- **Based on**: [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional)  \n- **Rules**: See the [commitlint reference rules](https://commitlint.js.org/reference/rules.html)  \n- **Custom Rules**: Our additional or overriding rules can be found here in the [commitlint.config.js](https://github.com/br-automation-com/ahub-lint-config/blob/main/commitlint.config.js). For instance, we may enforce max body length or other custom constraints.\n\n### Why Conventional Commits?\n\n1. **Standardized** commit messages improve readability and automation.  \n2. **Automatic** versioning and changelog generation become simpler.  \n3. **Consistent** commit messages help the entire team quickly understand the nature of changes.\n\n---\n\n## Usage\n\n### 1. GitHub Actions\n\nYou can fail your PR or push build if a commit doesn’t follow the conventional commit specification. Here’s a sample job that uses [@ahub-public/commitlint-config](https://www.npmjs.com/package/@ahub-public/commitlint-config) to verify commit messages:\n\n```yaml\ncommitlint:\n  runs-on: ubuntu-latest\n  steps:\n    - name: Check out code\n      uses: actions/checkout@v3\n      with:\n        fetch-depth: 0\n\n    - name: Install Node.js\n      uses: actions/setup-node@v4\n      with:\n        node-version: 20\n\n    - name: Install commitlint & public ahub lint config\n      run: |\n        npm install commitlint@latest @commitlint/config-conventional @ahub-public/commitlint-config\n        # Dynamically create a .commitlintrc.js file that extends your config\n        echo \"module.exports = { extends: ['@ahub-public/commitlint-config'] };\" > .commitlintrc.js\n\n    - name: Validate current commit (last commit) with commitlint\n      if: github.event_name == 'push'\n      run: npx commitlint --last --verbose\n\n    - name: Validate PR commits with commitlint\n      if: github.event_name == 'pull_request'\n      run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose\n```\n\n#### What’s happening:\n\nWe install Commitlint, the conventional config, and our ahub config from npm.\nWe generate a temporary .commitlintrc.js extending @ahub-public/commitlint-config.\nDepending on whether it’s a push or a pull request, we lint the appropriate commits.\n\n### 2. Local Usage (Pre-Commit Hook with Husky)\n\nTo catch invalid commit messages **before** pushing to GitHub, you can install Husky to manage local Git hooks.\n\n#### Install Husky and commitlint in your project:\n```bash\nnpm install -D husky commitlint @commitlint/config-conventional @ahub-public/commitlint-config\n```\n#### Add a local .commitlintrc.js referencing the ahub config:\n\n```js\n// .commitlintrc.js\nmodule.exports = {\n  extends: ['@ahub-public/commitlint-config']\n};\n```\n#### Create a commit-msg hook:\n\n```bash\nnpx husky add .husky/commit-msg \"npx commitlint --edit $1\"\ngit add .husky/commit-msg\n```\nNow, whenever you run git commit, Husky calls Commitlint to validate the message. If it doesn’t pass, it rejects the commit locally.\n\n## Additional Info\n\n- **VS Code Extension**: [Conventional Commits by vivaxy](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) helps you craft valid commit messages directly in VS Code.\n\n**Benefits**:\n- Automated release notes and versioning  \n- Streamlined collaboration and clearer commit history  \n\n**Happy Linting!**  \nHelp your team produce consistent commit messages for cleaner repos and smoother release workflows. Feel free to submit issues or pull requests to this repository if you have ideas or improvements.\n","readmeFilename":"README.md"}