-
Notifications
You must be signed in to change notification settings - Fork 127
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
WIP linter for Effective Dart #31
Conversation
Excluding lint analysis for a file seems to be broken in CLI dart-lang/sdk#25551
fix avoid_shadowing_type_parameters warning I need confirmation if T comes from Box or if the shadowing is voluntary. Revert "fix avoid_shadowing_type_parameters warning" This reverts commit 19a64241c5dbee435a41bedf0344ce6d9996fb07. Reland "fix avoid_shadowing_type_parameters warning"
Merge dev changes
Must verify if it works
I've pushed from the wrong account, also I'll fix the test ASAP. |
I'm almost done with the first fixes for the linter. |
Looks very useful to me, let's give it a go |
Ok, do you know if there is a way to test github actions locally? |
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.
LGTM so far
What warnings did you want to discuss?
Also, the docs for pedantic seem to indicate we should have an analysis_options.yaml
file?
I'm not aware of that but it's no problem if you commit your changes. I expect GitHub to execute your "actions" changes here in the PR. In that case, you can wait for the actions to finish to see the changes on the 'checks' tab in the PR and reiterate using |
So:
We have but we just import the pedantic rules right now. If we need to change some rules we can do so there. About the action I've edited the workflow and have a commit ready however it seems like we need a secret so that results can be posted as comments. |
Ah, it was the very first file... my bad
Would have to ask @greenrobot to set up a token for this repo. In the meantime, is there an option to just fail (actions fail if a command returns a non-zero return code) |
It has got really slow... |
Yes it is rather slow, I think it would be preferable to have it a separate step, actually If I understand GitHub Actions correctly, it can be a separate file, e.g.
|
Using different jobs seems to have no impact. I'm just wondering if it's linked to the missing secret. Maybe it's some timeout in the action. Just a supposition tho, I'll look into the action's code later. On another note I was looking at the pana reports and there seems to be a problem with dartfmt's line length, it seems that it's run on 80c lines. |
Ok I really have no idea why pana is failing on the generator. I'll look into it later in the morning or in the afternoon. |
I've found this https://github.com/nektos/act and I'll try it to test the actions locally |
FYI: raised an issue to avoid building the image on each pipeline: axel-op/dart-package-analyzer#1 |
I've found out why the analysis fails. The problem is that the objectbox_model_generator package is located inside the Moving the package is needed, inspiration could be taken from https://github.com/google/built_value.dart I had no luck in using |
I'll merge the changes this afternoon, should I move the two packages? |
Where would they move? I couldn't derive that from a look at |
I'd put them in two different directories. Basically:
edit: grammar |
Right, so they'd be basically two separate projects. Yeah, I guess it's fine. Could you pls paste the analysis report that has lead you to this? |
This is one of the pieces that got my attention in the report, the rest is still available in CI: https://github.com/objectbox/objectbox-dart/pull/31/checks?check_run_id=257476254
edit: better phrasing |
Ah, I didn't realize there are reports, let alone "errors" when the action passes. I'd have expected the CI checks to fail, like shown in the screenshot here for example: https://github.com/marketplace/actions/run-golangci-lint-with-reviewdog Is this something we can configure? Maybe a question for @axel-op? |
To get back to a rename, let's postpone that. I'm now going to try to cherry-pick formatting related commits so this PR doesn't get out of hand (too diverged from dev and other branches) |
I was a little confused the first time however I'm not sure which would be a better semantic. Something like "fail_on_warning: bool", "fail_on_error: bool", "fail_lower_when: double" (last one being the score). |
Maybe we could revert the CI integration and do a different PR for that. Linter should be fine now |
I've just pushed your linter related commits to dev. You can either create a new PR with the CI or rebase this one, dropping the old commits - whichever works for you better |
And thanks for the fixes! 🌮 |
I'll go with the new PR |
Again, thanks for the suggestion. Your comment made me read the documentation more carefully and I found out that GitHub Actions can also use, as Apps, the 'Checks' API that gives the possibility to post annotations on files. I implemented this during the last hours, and there are two changes:
|
Thanks, please don't forget to close this one when you don't need it anymore. |
Map common OBX_ERROR codes to exceptions Closes #31 See merge request objectbox/objectbox-dart!28
I've started to integrate pedantic as the linter but I need some direction to fix some warnings.
Also I need to actions to run once I'll add them to CI.