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

Add Weeder #9121

Open
ulysses4ever opened this issue Jul 13, 2023 · 5 comments
Open

Add Weeder #9121

ulysses4ever opened this issue Jul 13, 2023 · 5 comments
Labels
re: devx Improving the cabal developer experience (internal issue) type: enhancement

Comments

@ulysses4ever
Copy link
Collaborator

Mikolaj says:

PR that removes dead code (after asking around if it's not used in a weird way in some test script) is ... [very] valuable (and there are tools for that, e.g, weeder).

So, I'm opening a ticket about Weeder (didn't find any old one). It looks like the repo still has remnants of a past Weeder setup even:

I think it could be added to CI, perhaps?

@ulysses4ever ulysses4ever added type: enhancement re: devx Improving the cabal developer experience (internal issue) labels Jul 13, 2023
@ffaf1
Copy link
Collaborator

ffaf1 commented Jul 13, 2023

If we run weeder now, does it find dead code?

The only thing I am worried about is false positives.

@philderbeast
Copy link
Collaborator

There's a weeder gh-action.

@philderbeast
Copy link
Collaborator

Weeder has switched to using TOML for configuration. Also the .hie files in cabal-testsuite cannot yet be ignored by configuration and must be deleted (as a workaround) ocharles/weeder#56 (comment).

$ weeder --version
weeder version 2.7.0
hie version 9063
$ weeder --write-default-config
Did not find config: wrote default config to ./weeder.toml
incompatible hie file: /.../cabal-testsuite/PackageTests/CopyHie/setup.dist/work/dist/build/extra-compilation-artifacts/hie/HieLocal.hie
    this version of weeder was compiled with GHC version 9063
    the hie files in this project were generated with GHC version 9047
    weeder must be built with the same GHC version as the project it is used on

@philderbeast philderbeast mentioned this issue Dec 27, 2023
1 task
@philderbeast
Copy link
Collaborator

philderbeast commented Dec 27, 2023

From the Cabal-3.4.0.0 release notes and cabal-install-3.4.0.0 release notes:

@Mikolaj
Copy link
Member

Mikolaj commented Dec 28, 2023

I wonder if we can make CI run weeder, to avoid it bit-rotting so quickly (3 years) again? But it's tricky, because false positive can annoy users and also a temporarily unused code while developing should not cancel CI runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: devx Improving the cabal developer experience (internal issue) type: enhancement
Projects
None yet
Development

No branches or pull requests

4 participants