-
Notifications
You must be signed in to change notification settings - Fork 77
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
ci: resolve husky pre-push and pre-commit errors #10365
Conversation
@@ -15,7 +15,7 @@ function collectSassFiles(dir: string): string[] { | |||
|
|||
try { | |||
fs.readdirSync(dir, { recursive: true, withFileTypes: true }).forEach(dirent => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to recursively check files starting in the root directory or can we be more specific?
The only relevant directories are packages/calcite-components/src
and packages/calcite-design-system/dist/scss
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the suggestion to narrow the search scope mainly for performance reasons? I’d like to avoid an allowlist, so we don’t need to (remember to) update this script if our Sass file directories change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing, @benelan!
@@ -15,7 +15,7 @@ function collectSassFiles(dir: string): string[] { | |||
|
|||
try { | |||
fs.readdirSync(dir, { recursive: true, withFileTypes: true }).forEach(dirent => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the suggestion to narrow the search scope mainly for performance reasons? I’d like to avoid an allowlist, so we don’t need to (remember to) update this script if our Sass file directories change.
fi | ||
done | ||
|
||
if [ -n "$(git diff --name-only -- "packages/calcite-components/.stylelintrc.json")" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ Thanks for fixing this one.
…estone-estimates * origin/dev: (29 commits) fix(input-time-zone): fix region mode labeling and value mapping (#10345) fix(dropdown): open dropdown on `ArrowDown` & `ArrowUp` keys (#10264) refactor(components): reduce post-migration TypeScript errors (#10356) refactor: do not use Host in functional components (#10352) refactor(tests): reduce TypeScript errors (#10344) feat(alert): add component tokens (#10218) fix(card): properly handle slotted elements (#10378) refactor(panel): remove duplicate tailwind class (#10379) feat(popover, action): add component tokens (#10253) chore(t9n): add translations (#10339) feat: add 3d building, 3d building parameter, divide, parcel, spaces, spaces parameter, square brackets x, n variable, zoning parameter (#10373) build: update browserslist db (#10370) ci: resolve husky pre-push and pre-commit errors (#10365) docs: update component READMEs (#10371) feat(text-area): add component tokens (#10343) fix(action): prefer `disabled` in favor of `aria-disabled` (#10367) docs(a11y): add reference to a11y guidance to issue template (#10372) chore(action): add new string for accessible indicator label (#10360) feat(chip): add component tokens (#10179) feat(avatar): add component tokens (#10280) ...
Summary
Resolve a few errors in our
pre-commit
andpre-push
hooks:The
support/updateStylelintCustomSassFunctions.ts
script was trying to open scss files in the root directory.The stylelint config file extension was incorrect.
The
pre-push
hook was only protectingmain
when it should protectrc
anddev
too.Husky requires scripts to be POSIX compliant, which means we can't use bash features.
Replace the
read
prompt's-p
and-n
flags with a printf and case statementReplace double bracket conditionals used for pattern matching with
grep -qE
in thepre-commit
hook