-
Notifications
You must be signed in to change notification settings - Fork 61
Knip CI #897
Comments
I almost have it integrated, need still to execute a few tests... |
So I realized only today that I have mixed feelings on this. Knip is fantastic however there are some identifiers which are used in runtime which I'm not sure how to annotate in knip. For example, issue state enum has three values: opened, closed, reopened (if I recall correctly) We only directly reference opened in the code so knip is satisfied. The other two it complains about. When I removed the other two, ajv was throwing a validation error on the payload because they were missing. Any ideas @gitcoindev |
hi @pavlovcik I am still experimenting on GitHub actions, need about 1-2 hrs to open a pr. I discovered that Knip has a quite flexible configuration if it provides false positives: https://knip.dev/guides/handling-issues/
So in all we should be able to fine tune it to get the desired output, also check or skip the required GitHub action enum values. |
By the way. For the sake of saving us time with merge conflicts, would you mind working off of my @wannacfuture is tidying up some final runtime errors and then we should be good to merge and deploy! |
Yes, sure. Btw. great news! So far I have a still dirty (but working) version on my fork. It gives
I analysed the extended JSON output from Knip and found out that it also gives pointers to unused exports so this could also potentially be injected directly as comments but they are not parsed in the default GitHub action, yet. I forked the GitHub action and will try to extend it. An example for enums:
and also exports:
I will try to get those working as well and submit a PR based on |
All right I have this working. I enabled also unused exports annotations directly in the sources, which was not available before. I will now prepare a PR based on The only thing remaining will be to configure Knip to give us the desired output and ignore what should be ignored. |
Resolves: ubiquity#897
/start |
Skipping |
Resolves: ubiquity#897
Hi @pavlovcik I opened 0x4007#57 this pull request targets directly your |
@gitcoindev I just realized that you should have received credit for this task. Once the payout flow is working again let's address this. Thanks for your contribution! |
Thank you, too, for addressing this! |
! action has an uncaught error |
@gitcoindev the deadline is at 2024-02-02T14:28:52.758Z |
! action has an uncaught error |
+ Evaluating results. Please wait... |
! action has an uncaught error |
+ Evaluating results. Please wait... |
@gitcoindev can you try and claim this reward? |
/query @gitcoindev |
! action has an uncaught error |
Just making sure that this has been addressed? |
/query @gitcoindev |
|
Hi @pavlovcik , wallet address is set correctly now, but the old permit is pointing to a wrong address. The permit would have to be regenerated. |
No problem. I just voided it and will regenerate. |
@gitcoindev the deadline is at 2024-02-15T18:09:26.405Z |
+ Evaluating results. Please wait... |
|
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Specification | 1 | 23.4 |
Issue | Comment | 6 | 38.4 |
Conversation Incentives
Comment | Formatting | Relevance | Reward |
---|---|---|---|
Use [Knip](https://knip.dev/) in a GitHub Action and annotate al... | 23.4a: count: 1 score: "1" words: 1 code: count: 2 score: "2" words: 3 hr: count: 1 score: "1" words: 0 | 1 | 23.4 |
So I realized only today that I have mixed feelings on this.K... | 18 | 0.63 | 18 |
By the way. For the sake of saving us time with merge conflicts,... | 9.8code: count: 1 score: "1" words: 2 | 0.735 | 9.8 |
@gitcoindev I just realized that you should have received credit... | 5.6 | 0.83 | 5.6 |
@gitcoindev can you try and claim this reward?... | 1.6 | 0.795 | 1.6 |
Just making sure that this has been addressed?... | 1.6 | 0.755 | 1.6 |
No problem. I just voided it and will regenerate.... | 1.8 | 0.76 | 1.8 |
[ 299 WXDAI ]
@gitcoindev
Contributions Overview
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Task | 1.00 | 225 |
Issue | Comment | 7 | 0 |
Issue | Comment | 7 | 74 |
Conversation Incentives
Comment | Formatting | Relevance | Reward |
---|---|---|---|
I _almost_ have it integrated, need still to execute a few tests... | - | 0.555 | - |
hi @pavlovcik I am still experimenting on GitHub actions, need a... | -code: count: 1 score: "0" words: 0 | 0.78 | - |
> By the way. For the sake of saving us time with merge conflict... | -li: count: 2 score: "0" words: 14 code: count: 4 score: "0" words: 4 | 0.72 | - |
All right I have this working. I enabled also unused exports ann... | -code: count: 1 score: "0" words: 2 | 0.71 | - |
Hi @pavlovcik I opened https://github.com/pavlovcik/ubiquibot/pu... | -code: count: 4 score: "0" words: 6 | 0.72 | - |
> @gitcoindev I just realized that you should have received cred... | - | 0.76 | - |
Hi @pavlovcik , wallet address is set correctly now, but the old... | - | 0.74 | - |
I _almost_ have it integrated, need still to execute a few tests... | 1.1 | 0.555 | 1.1 |
hi @pavlovcik I am still experimenting on GitHub actions, need a... | 15.4code: count: 1 score: "1" words: 0 | 0.78 | 15.4 |
> By the way. For the sake of saving us time with merge conflict... | 34.1li: count: 2 score: "2" words: 14 code: count: 4 score: "4" words: 4 | 0.72 | 34.1 |
All right I have this working. I enabled also unused exports ann... | 10.7code: count: 1 score: "1" words: 2 | 0.71 | 10.7 |
Hi @pavlovcik I opened https://github.com/pavlovcik/ubiquibot/pu... | 9.6code: count: 4 score: "4" words: 6 | 0.72 | 9.6 |
> @gitcoindev I just realized that you should have received cred... | 0.6 | 0.76 | 0.6 |
Hi @pavlovcik , wallet address is set correctly now, but the old... | 2.5 | 0.74 | 2.5 |
Interesting... it throws 'THIS REWARD HAS ALREADY BEEN CLAIMED OR INVALIDATED.' error (I am sorry for caps it was copy pasted -). Could you please check your permit? |
It lets me claim mine. I realize that the nonce encodes the issue id and your GitHub user id. The wrong wallet was associated to your user ID and I invalidated it I think (I don't remember.) I'll just send you a manual payment then. https://gnosisscan.io/tx/0x1a576044cb22bff3b54311f6751cfc1ca043bc30c57df8b6491761a15a57cbe1 |
Thank you a lot @pavlovcik ! |
Use Knip in a GitHub Action and annotate all of the unused code inside of the code view in pull requests.
You can see an example of how to annotate in our
kebab-case.yml
however the annotations should be specific to the line that must be removed.ubiquibot/.github/workflows/kebab-case.yml
Line 42 in c015fc7
Knip is great to keep code bloat down, but I wasn't sure how to have it automatically run (I don't think it makes sense to as a commit hook, for example.)
The text was updated successfully, but these errors were encountered: