-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore(deps): upgrade @dhis2/cli-style to latest alpha #174
Conversation
This is actually specific for the dhis2/cli-style repo, because it needs to run itself. In an app, we should use |
Debug messages in cli-style are heavily directed at being useful for debugging, so I'm a bit surprised to see the |
The |
Sure, as long as we run the tests on CI I'm OK with that. |
I missed this detail. 👍 |
Yes, this one is annoying. They call that "point.case" in ls-lint and we need to figure out how to handle it. |
|
Yeah exactly. So it seems to install the hooks that were meant for internal usage in the repo in this app when I ran
Ah so that's why. I took it from our shared workflows repo: https://github.com/dhis2/workflows/blob/master/ci/dhis2-verify-app.yml. So I'd say that we should probably set this to false by default then. What do you think?
I agree. So it seems that the default hook it installed for me was without the --staged. Is that because of config in this repo, or is that something we need to address in cli-style?
That's the direction I'd go I think. Though I could also see us using onlyChanged in the pre commit hook.
I see. Yeah tricky that there's a bit of overlap in our naming conventions.
I see, thanks. Why do we disable colors there? Personally I find it quite useful as a quick way to scan for errors/warnings when I'm scrolling through a list of them. |
Let me know by the way if it would help if I submit PRs for the changes I'm proposing. |
I mean, yes? 😆 |
Decisions made in another time/dimension intersection. We can remove this now that the philosophy has changed. |
Haha, yeah I guess I meant, do you agree, and shall I submit a PR. Don't know if you were already working on it. More in that manner. Didn't mean to ask: "Hey, is it helpful if I help?" 😋 |
Yeah, that's a bug.
I don't see the d2-style.config.js file in this repo, so I think it's something in cli-style. |
No, I hadn't caught these issues but now that you've pointed them out I can fix them and assign you to review. |
👍 Cool, sounds good! |
|
I am pretty sure we had that as |
I'll close this PR as it's served its purpose as a testbed. I'll create follow up issues for anything that hasn't been addressed yet. |
This isn't really a review for the proposed changes in this PR, just used this to have some context for the cli-style changes on alpha. I've just noted down what stood out. I don't think that it's really necessary to deal with all the notes for the current release, we could deal with some of these issues later.
Todo
Short notes
--no-verify
, and I've heard that from others as well. I think we'd probably want an approach that doesn't push people towards ignoring it and making a habit out of that (ignoring).d2-style check
andjavascript > eslint
string are highlighted correctly, but not thewarning
string for example. I'm not using true color (terminal is true color capable though), just the 16 ANSI colors. Are we using the correct ANSI escape sequences everywhere?--no-verify
.d2-style add ls-lint
and thend2-style check fs
on the latest commit of this branch. Works well, though initially I was surprised that it didn't ignore .d2. I expected d2-style to ignore everything in my gitignore, just like prettier and eslint. But I see that ls-lint has its own config with an ignore section. Maybe we should add .d2 to the defaults there.2021/04/20 16:15:27 ./src/hooks/jobs/use-submit-job.test.js failed for rules: kebabcase
. I would have expected it to allow this to pass as the test.js extension is pretty common across our codebases and not really violating the no-caps rule. At least I assume that that is why it's failing. Also happens with d2 config for example:2021/04/20 16:15:27 ./d2.config.js failed for rules: kebabcase
Hooks
The default hooks, installed with d2-style install, didn't work for me. This for example:
Exits with:
/Users/ismay/Projects/github/dhis2/scheduler-app/.hooks/commit-msg: line 4: ./bin/d2-style: No such file or directory
.pwd
in that script yields:/Users/ismay/Projects/github/dhis2/scheduler-app
so I guess that makes sense?I changed the hooks in this commit (654996d), following these instructions: https://typicode.github.io/husky/#/?id=locally-installed-binaries (running them via the package manager basically), and that fixed it.