Skip to content

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Jun 8, 2022

🧭 What and Why

I wanted to add a mix of positive, negative, positive glob to the file to unstage, but it was not possible because we split positive and negative glob before matching.

Micromatch is already able to handle a list of pattern, we don't need extra logic, I didn't saw any edge cases while testing.

Changes included:

  • Remove the logic for micromatch
  • Handle the tests pattern directly in the hook
  • Simplify the list of files for java
  • Skip the hook while a merge is in progress (we should also skip while rebasing)

🧪 Test

Try to add files to stage and unstage and run the command node scripts/ci/husky/pre-commit.js

@millotp millotp self-assigned this Jun 8, 2022
@netlify
Copy link

netlify bot commented Jun 8, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 6bf844c
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/62a0a788444c360009af6614

@algolia-bot
Copy link
Collaborator

algolia-bot commented Jun 8, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

@millotp millotp force-pushed the chore/simplify-hook branch from c7fe19d to 5f56782 Compare June 8, 2022 11:52
@millotp millotp requested review from eunjae-lee and shortcuts June 8, 2022 11:52
@millotp millotp force-pushed the chore/simplify-hook branch from 5f56782 to 078ea29 Compare June 8, 2022 11:59
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice

@millotp millotp requested a review from shortcuts June 8, 2022 13:50
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :D

module.exports = {
patterns: [
// Ignore the roots and go down the tree by negating hand written files
'specs/bundled/*.yml',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's closely look at the next PRs pushed code so we can make sure we did not broke anything here

@@ -1,24 +1,63 @@
/* eslint-disable @typescript-eslint/no-var-requires */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems good for now! We can add more tests later :D

@millotp millotp merged commit bdcd5d2 into main Jun 8, 2022
@millotp millotp deleted the chore/simplify-hook branch June 8, 2022 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants