fix: issue with pre-commit husky hook (#2669)

* fix: issue with pre-commit husky hook
CODE-2402
Shivanand Sonnad 2024-09-09 08:08:32 +00:00 committed by Harness
parent 16ba4e056f
commit 81e3e6f029
3 changed files with 11 additions and 19 deletions

View File

@ -1,5 +1,13 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
cd web
npx lint-staged
# Check for changes in specific folders
CHANGED_FILES=$(git diff --cached --name-only)
if echo "$CHANGED_FILES" | grep -E '^(web/src/ar/)' > /dev/null; then
echo "Running checks for changes in src/ar"
cd web
npx lint-staged
else
echo "No changes in src/ar, skipping checks"
fi

View File

@ -1,5 +1,5 @@
# Apply checks for artifact registry (ar) code
'*': 'sh src/ar/scripts/license/stamp.sh'
'src/ar/**/*': 'sh src/ar/scripts/license/stamp.sh'
'src/ar/**/*.{ts,tsx,p1}': 'prettier --check'
'src/ar/**/*.{ts,tsx,p2}': 'eslint --rulesdir src/ar/scripts/eslint-rules'
'src/ar/**/*.{ts,tsx,p3}': 'sh src/ar/scripts/typecheck-staged.sh'

View File

@ -1,19 +1,3 @@
/*
* Copyright 2024 Harness, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This file is auto-generated. Please do not modify this file manually.
* Use the command `yarn strings` to regenerate this file.