-
Notifications
You must be signed in to change notification settings - Fork 18
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
warn if process-compose is imported but not used #4
Conversation
in | ||
{ | ||
options = { | ||
perSystem = mkPerSystemOption | ||
({ config, self', inputs', pkgs, system, ... }: { | ||
options.process-compose = mkOption { | ||
default = warn "process-compose flake module was imported but not used" { }; |
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.
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.
How about an option for linting messages that don't warn by default?
I could add that to the debug attribute in flake-parts. That way we can figure some things out for the user without having to bother them with warnings which may or may not apply.
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.
You could try the lint
options implemented in hercules-ci/flake-parts#134
Docs:
nix build github:hercules-ci/flake.parts-website --override-input flake-parts flake-parts/lint \
&& xdg-open result/options/flake-parts.html
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.
I think having some kind of information is neat because it makes you aware that you have something in your flake inputs you don't actually use. I chose to warn because it was the closest thing I found. Defaulting to an empty attribute-set makes it difficult to tell right away whether you use it or not in a big project. Also the warning does not make your build fail.
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.
I would be happy if flake-part itself would inform me about unused modules.
In the current I'll close this PR (as it is also quite out of date from |
No description provided.