Skip to content

Commit

Permalink
chore: add commitlint config for scopes
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 591061701
  • Loading branch information
asyncLiz authored and copybara-github committed Dec 14, 2023
1 parent 4095c06 commit b0eea7f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- run: npm install -g commitlint @commitlint/config-conventional
- run: 'echo "${PR_TITLE}" | commitlint -x @commitlint/config-conventional'
- run: npm install -g @commitlint/cli @commitlint/config-conventional
- run: 'echo "${PR_TITLE}" | commitlint'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
*.js
!web-test-runner.config.js
!css-to-ts.js
!commitlint.config.js
*.css
*.css.ts
*.map
Expand All @@ -25,4 +26,4 @@ catalog/site/about/images
catalog/*.tsbuildinfo
catalog/stories/*/
!catalog/stories/components/
!catalog/src/types/**/*.d.ts
!catalog/src/types/**/*.d.ts
45 changes: 45 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @license
* Copyright 2023 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

export default {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2,
'always',
[
// Use "/" for multiple scopes: `fix(button/checkbox): subject"`
// Omit scope for broad "all" changes.
'button',
'catalog',
'checkbox',
'chips',
'color',
'dialog',
'divider',
'elevation',
'fab',
'field',
'focus',
'icon',
'iconbutton',
'labs',
'list',
'menu',
'progress',
'radio',
'ripple',
'select',
'slider',
'switch',
'tabs',
'textfield',
'tokens',
'typography',
],
],
},
};

0 comments on commit b0eea7f

Please sign in to comment.