🎉 New feature: the poly check command will show unused bricks in projects #361
DavidVujic
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Adding a new feature to the
poly check
command: report any unused bricks in projects.If a project is including a Polylith brick that is not needed in the project, this new feature will report on it. The feature is available in v1.32.0 of the CLI and v1.39.0 of the Poetry plugin.
⭐ This is an idea from Discussion #357 ⭐
Currently, the command won't exit with a fail code and is only reporting it as information. I've chosen to do so to not cause any issues for teams using the
poly check
command in their continuous integration setups - and if there are reasons to include seemingly "unused" code in projects. Suggested usage is pre-commit or add it to your existing local developer machine commands.You can use it in your CI also, but it will only print out information (not exit with a fail code).
Usage, examples:
When there's a brick not used in a specific project, the output will be:
What if adding the unused component is intended?
I was considering to add an extra flag to the command, and/or TOML configuration to configure bricks to ignore. But I would rather recommend to add any "unused" components in the base of a project, with a suitable "ignore linting this row".
Example, a base brick defining a component not actually used in code, but still needed in a project:
A possibly better solution: if there is code that is used to access features with the command line in a production environment, add a new base! That's a perfect use case for adding another base (an entry point to your service).
I hope you will find this addition useful! Let me know how this thing works out for you, and please let me know if there are any unexpected consequences or issues caused by this new addition to the
poly check --strict
command 🙏Implementation details in #360
Beta Was this translation helpful? Give feedback.
All reactions