forked from FreeTubeApp/FreeTube
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Git Hooks to run lint (FreeTubeApp#1788)
* + Add package @arkweid/lefthook * Add git hook pre-commit for linting changed files only * Update lefthook.yml about `glob` Co-authored-by: absidue <[email protected]> * Update lefthook.yml to use `yarn run` instead of `npx` Co-authored-by: absidue <[email protected]> Co-authored-by: absidue <[email protected]>
- Loading branch information
1 parent
180a89d
commit ba0bcee
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,46 @@ | ||
|
||
# Refer for explanation to following link: | ||
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md | ||
pre-commit: | ||
parallel: true | ||
commands: | ||
lint: | ||
# Only runs when any file with filename | ||
# matching the glob is being committed | ||
glob: "*.{js,vue}" | ||
run: yarn run eslint --no-color {staged_files} | ||
|
||
|
||
|
||
# EXAMPLE USAGE | ||
# | ||
# pre-push: | ||
# commands: | ||
# packages-audit: | ||
# tags: frontend security | ||
# run: yarn audit | ||
# gems-audit: | ||
# tags: backend security | ||
# run: bundle audit | ||
# | ||
# pre-commit: | ||
# parallel: true | ||
# commands: | ||
# eslint: | ||
# glob: "*.{js,ts}" | ||
# run: yarn eslint {staged_files} | ||
# rubocop: | ||
# tags: backend style | ||
# glob: "*.rb" | ||
# exclude: "application.rb|routes.rb" | ||
# run: bundle exec rubocop --force-exclusion {all_files} | ||
# govet: | ||
# tags: backend style | ||
# files: git ls-files -m | ||
# glob: "*.go" | ||
# run: go vet {files} | ||
# scripts: | ||
# "hello.js": | ||
# runner: node | ||
# "any.go": | ||
# runner: go run |
This file contains 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 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 |
---|---|---|
|
@@ -15,6 +15,11 @@ | |
"@jridgewell/gen-mapping" "^0.1.0" | ||
"@jridgewell/trace-mapping" "^0.3.9" | ||
|
||
"@arkweid/lefthook@^0.7.7": | ||
version "0.7.7" | ||
resolved "https://registry.yarnpkg.com/@arkweid/lefthook/-/lefthook-0.7.7.tgz#12951b09b955d8054885ffe929aa07a49f39027c" | ||
integrity sha512-Eq30OXKmjxIAIsTtbX2fcF3SNZIXS8yry1u8yty7PQFYRctx04rVlhOJCEB2UmfTh8T2vrOMC9IHHUvvo5zbaQ== | ||
|
||
"@babel/[email protected]": | ||
version "7.12.11" | ||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" | ||
|