gauge icon indicating copy to clipboard operation
gauge copied to clipboard

CLI command to find unused step implementations

Open camjackson opened this issue 4 years ago • 0 comments

As a developer I want a CLI command to find unused step implementations So that I can fail the build on dead code

Problem Because step usages (in spec files) are so separated from step implementations (in code files), it's really easy to delete the final usage of a step without realising it, leaving dead code behind. The vscode integration is great for finding these - I just opened up a typescript file and deleted about 10 different steps that all had a little "0 reference(s)" flag on them. But that only helps if you happen to stumble across the unused steps and notice the issue.

Solution What would be awesome is if the CLI could tell me about steps that have 0 references, either just as a warning to the developer, or to fail the build straight away. Maybe it could be a flag to the validate command? E.g.

gauge validate --no-unused-steps specs/

camjackson avatar Feb 03 '21 07:02 camjackson