chore: add commitlint config for scopes

PiperOrigin-RevId: 591061701
This commit is contained in:
Elizabeth Mitchell 2023-12-14 15:01:40 -08:00 committed by Copybara-Service
parent 4095c06e5a
commit b0eea7f59d
3 changed files with 51 additions and 3 deletions

View File

@ -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
.gitignore vendored
View File

@ -2,6 +2,7 @@ node_modules
*.js
!web-test-runner.config.js
!css-to-ts.js
!commitlint.config.js
*.css
*.css.ts
*.map
@ -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
commitlint.config.js Normal file
View File

@ -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',
],
],
},
};