chore: configure pre-commit stages and add build hook #83
@@ -55,3 +55,10 @@ repos:
|
|||||||
files: ^(index\.js|monitor\.js|package\.json|package-lock\.json)$
|
files: ^(index\.js|monitor\.js|package\.json|package-lock\.json)$
|
||||||
|
|
|||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
stages: [pre-commit]
|
stages: [pre-commit]
|
||||||
|
AutoReview
commented
The file The file `monitor.js` is not present in the repository root. If this is a future file, keep it; otherwise, this entry will never trigger the hook for that specific file. Additionally, the `build` script in `package.json` only compiles `index.js`.
AutoReview
commented
`monitor.js` is included in the file filter but does not exist in the repository. If there are no plans to add this file, it should be removed from the regex.
|
|||||||
|
- id: add-dist
|
||||||
|
Philipp marked this conversation as resolved
AutoReview
commented
`monitor.js` does not exist in the repository root. If this is not a planned file, it should be removed from the regex to avoid confusion. Additionally, the `build` script in `package.json` currently only processes `index.js`.
|
|||||||
|
name: stage-distribution
|
||||||
|
AutoReview
commented
Same as above, Same as above, `monitor.js` is referenced here but is missing from the file tree.
|
|||||||
|
entry: git add dist/
|
||||||
|
language: system
|
||||||
|
files: ^(index\.js|monitor\.js|package\.json|package-lock\.json)$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
AutoReview
commented
This is a good solution to ensure the compiled distribution is always included in the commit that modified the source. This is a good solution to ensure the compiled distribution is always included in the commit that modified the source.
AutoReview
commented
Same here, Same here, `monitor.js` is referenced but does not exist in the file tree.
|
|||||||
|
|||||||
Since
npm run buildupdates thedist/directory, these changes won't be included in the current commit unless they are staged.You might want to change the entry to:
entry: /bin/bash -c "npm run build && git add dist/"Or ensure that developers are aware they need to stage
dist/if the hook fails (though usually, pre-commit hooks should ideally handle the staging if they modify files).