Skip to content

Conversation

yvan-sraka
Copy link
Contributor

This PR adds a CI job that runs the nix run github:astro/deadnix -- --edit --no-lambda-pattern-names command to remove dead code. If this command results in any uncommitted changes, the CI job will fail, indicating the presence of dead code in the repository that needs to be removed. See #1756

@yvan-sraka yvan-sraka requested a review from angerman June 18, 2023 11:25
@yvan-sraka yvan-sraka self-assigned this Jun 18, 2023
@angerman
Copy link
Collaborator

Can this create a patch? Or even better suggestions to commit?

@yvan-sraka
Copy link
Contributor Author

Yes! We can use GitHub Actions like, e.g., reviewdog/action-suggester to generate suggestions :) WDYT?

@yvan-sraka
Copy link
Contributor Author

Not sure to understand if that's the GA which is faulty, otherwise I would gladly use it also to check Nix code formatting / LSP insights too :)

I'm not sure if the ReviewDog GA is faulty? Otherwise, I would gladly use it to check Nix code formatting and display LSP insights as well :)

Copy link
Member

@andreabedini andreabedini left a comment

Choose a reason for hiding this comment

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

Is it supposed to fail if there are warnings? because it didn't

https://github.com/input-output-hk/haskell.nix/actions/runs/5789319513/job/15690115119#step:3:7

@yvan-sraka
Copy link
Contributor Author

Is it supposed to fail if there are warnings? because it didn't

I choose to not make a CI test fail, but rather to just display hints in the PR diffs view (that's what https://github.com/reviewdog/action-suggester does). I'm not sure if it's more convenient?

Copy link
Member

@andreabedini andreabedini left a comment

Choose a reason for hiding this comment

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

Can you make a separate workflow? pipeline.yml is a bit of a kitchen sink. Maybe move all lints to a new lints.yml workflow?

Is there anywhere I can see a preview of the output?

@yvan-sraka
Copy link
Contributor Author

yvan-sraka commented Sep 12, 2023

Can you make a separate workflow? pipeline.yml is a bit of a kitchen sink. Maybe move all lints to a new lints.yml workflow?

Yes! I updated the PR :)

Is there anywhere I can see a preview of the output?

I believe the workflow can't be run unless merged into main :/

Btw, I now directly rely on https://github.com/reviewdog/reviewdog?tab=readme-ov-file#diff rather than on my fork (I would prefer to not have to rely on external tooling, but the needed GitHub feature seems missing cli/cli#5905 …)

@yvan-sraka yvan-sraka force-pushed the yvan-sraka-patch-1 branch 2 times, most recently from 5e051b3 to e76bcac Compare September 12, 2023 17:42
@yvan-sraka yvan-sraka force-pushed the yvan-sraka-patch-1 branch 2 times, most recently from b100ffc to 255f2ad Compare September 14, 2023 12:36
This PR adds a CI job that runs the `nix run github:astro/deadnix -- --edit \
--no-lambda-pattern-names` [1] command to detect dead code.

And then use reviewdog/action-suggester [2] for actionable code changes
comments within GitHub UI.

[1] #1756
[2] https://github.com/reviewdog/action-suggester
@yvan-sraka
Copy link
Contributor Author

So I give it a try to it in my fork, and here what's expected: yvan-sraka#1 :)

@yvan-sraka yvan-sraka merged commit e96e767 into master Sep 17, 2023
@yvan-sraka yvan-sraka deleted the yvan-sraka-patch-1 branch September 17, 2023 06:36
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