Skip to content
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

fix: wrong hooks where installed by default #385

Merged
merged 2 commits into from
Apr 22, 2021
Merged

Conversation

varl
Copy link
Contributor

@varl varl commented Apr 21, 2021

No description provided.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

This hasn't fixed it for me. If I use the d2-style on this branch, and then run d2-style install, it still installs the hooks that can be found here: https://github.com/dhis2/cli-style/tree/alpha/.hooks

@ghost
Copy link

ghost commented Apr 21, 2021

Maybe I'm doing it wrong? I see it accepts a --config flag. I'm not passing that though. So since I'm not passing that it seems to default to the one in cli-style. Is the user expected to have and pass a d2-style.config.js?

@varl
Copy link
Contributor Author

varl commented Apr 22, 2021

Maybe I'm doing it wrong? I see it accepts a --config flag. I'm not passing that though. So since I'm not passing that it seems to default to the one in cli-style. Is the user expected to have and pass a d2-style.config.js?

No, that isn't necessary.

@varl
Copy link
Contributor Author

varl commented Apr 22, 2021

This hasn't fixed it for me. If I use the d2-style on this branch, and then run d2-style install, it still installs the hooks that can be found here: https://github.com/dhis2/cli-style/tree/alpha/.hooks

How are you running this branch in another project? Are you using e.g. /path/to/cli-style/bin/d2-style install or a yarn link followed by yarn d2-style install ?

@varl
Copy link
Contributor Author

varl commented Apr 22, 2021

Ah, @ismay. I found it. 1fc1c04

We were resolving the d2style config in relation to the package (cli-style), and not the project (cwd).

@ghost
Copy link

ghost commented Apr 22, 2021

Ah, @ismay. I found it. 1fc1c04

We were resolving the d2style config in relation to the package (cli-style), and not the project (cwd).

That seems to have done it, both hooks work for me locally after this fix and a clean install.

How are you running this branch in another project? Are you using e.g. /path/to/cli-style/bin/d2-style install or a yarn link followed by yarn d2-style install ?

I was testing it by running y add --dev git+https://github.com/dhis2/cli-style#wrong-hooks-installed and then an npx d2-style install --clean

@ghost ghost self-requested a review April 22, 2021 08:18
@varl varl merged commit 3ac82f4 into alpha Apr 22, 2021
@varl varl deleted the wrong-hooks-installed branch April 22, 2021 08:22
dhis2-bot added a commit that referenced this pull request Apr 22, 2021
# [8.0.0-alpha.10](v8.0.0-alpha.9...v8.0.0-alpha.10) (2021-04-22)

### Bug Fixes

* ignore .d2 directory ([#386](#386)) ([6a473f2](6a473f2))
* wrong hooks where installed by default ([#385](#385)) ([3ac82f4](3ac82f4))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 8.0.0-alpha.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

dhis2-bot added a commit that referenced this pull request May 5, 2021
# [8.0.0](v7.3.0...v8.0.0) (2021-05-05)

### Bug Fixes

* allow eslint to print colors ([#384](#384)) ([c95a184](c95a184))
* ignore .d2 directory ([#386](#386)) ([6a473f2](6a473f2))
* match files from project root ([b77ef35](b77ef35))
* wrong hooks where installed by default ([#385](#385)) ([3ac82f4](3ac82f4))

### Code Refactoring

* remove husky ([752b944](752b944))

### Features

* commit check can read from a custom file ([366be0c](366be0c))
* delete deprecated configuration files ([c961647](c961647))
* lint file system for consistent names ([#379](#379)) ([2bfb5ef](2bfb5ef))
* new and improved d2-style ([#378](#378)) ([f8279e5](f8279e5))
* opt-in git hooks ([#333](#333)) ([a3bc415](a3bc415))
* show eslint warnings ([#368](#368)) ([abe4668](abe4668))

### BREAKING CHANGES

* The verb (check/apply) is now moved to the top-level.  E.g.
"d2-style js check" becomes "d2-style check js". This is to allow all checkers
to run with a single command: "d2-style check"
* "d2-style install" is no longer used to set up linters.  As of
husky@5 the tool is vastly simplified and much faster. Hooks can be installed
manually with "d2-style install", but is also run as a "post-install" script
that we control for consistency. Configuration is added to the project with the
"d2-style add" command.
* Husky has been removed from cli-style. You will need to
remove hooks that reference husky.sh in .git/hooks.
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants