-
Notifications
You must be signed in to change notification settings - Fork 29
feat: added commit message linting to Inventory API #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8658b5e
feat: added commit message linting to Inventory API
2b636b4
upadated nodejs version
abhijeetw035 3ec04b4
fix: fixed package.json and updated commit linting
eddcb08
Merge branch 'fix-issue-82' of github.com:abhijeetw035/Inventory-API β¦
bf06ad8
fix: fix commit linting and github workflow
69199f0
fix: removed The shebang line
ef45175
fix: upadated commit-lint file name in workflow
eaf1e66
fix: fixed commit lint workflow
7ee445e
fix: fetch the base branch before computing merge-base
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Commit Compliance | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| commitlint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code with submodule | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| submodules: true | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci --legacy-peer-deps | ||
|
|
||
| - name: Run commitlint on PR | ||
| run: | | ||
| git fetch --no-tags --prune --depth=1 https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git ${{ github.event.pull_request.base.ref }} | ||
| BASE_SHA=$(git merge-base FETCH_HEAD ${{ github.event.pull_request.head.sha }}) | ||
| npx --no -- commitlint --from "$BASE_SHA" --to ${{ github.event.pull_request.head.sha }} --verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| target/ | ||
| !.mvn/wrapper/maven-wrapper.jar | ||
|
|
||
| node_modules | ||
|
|
||
| ### STS ### | ||
| .apt_generated | ||
| .classpath | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx --no -- commitlint --edit "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx --no -- lint-staged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| module.exports = { | ||
| extends: ['@commitlint/config-conventional'], | ||
| rules: { | ||
| 'body-leading-blank': [1, 'always'], | ||
| 'body-max-line-length': [2, 'always', 100], | ||
| 'footer-leading-blank': [1, 'always'], | ||
| 'footer-max-line-length': [2, 'always', 100], | ||
| 'header-max-length': [2, 'always', 100], | ||
| 'subject-case': [ | ||
| 2, | ||
| 'never', | ||
| ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], | ||
| ], | ||
| 'subject-empty': [2, 'never'], | ||
| 'subject-full-stop': [2, 'never', '.'], | ||
| 'type-case': [2, 'always', 'lower-case'], | ||
| 'type-empty': [2, 'never'], | ||
| 'type-enum': [ | ||
| 2, | ||
| 'always', | ||
| [ | ||
| 'build', | ||
| 'chore', | ||
| 'ci', | ||
| 'docs', | ||
| 'feat', | ||
| 'fix', | ||
| 'perf', | ||
| 'refactor', | ||
| 'revert', | ||
| 'style', | ||
| 'test', | ||
| ], | ||
| ], | ||
| } | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.