Skip to content

Conversation

LiamPattinson
Copy link
Collaborator

While trying out 7a4b965 in #108, I found that the explain command was no longer working properly. This PR fixes the bug, and while I was at it I also improved the output for explain, updated the README, and improved the help text that's printed when things go wrong.

explain now prints the name of the rule alongside the code, but it's in camel-case. There are a few Rust libraries that allow you to convert to other cases, like sentence case, but these aren't clever enough to rename IOError to IO error or NonStandardFileExtension to Non-standard file extension, so for now I've left it at camel-case.

@LiamPattinson
Copy link
Collaborator Author

I added a small function to the map_codes macro so you can get the name of a Rule from the enum, but this feels like something that should have already been there. Have I overlooked where this is defined?

Copy link
Member

@ZedThree ZedThree left a comment

Choose a reason for hiding this comment

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

Nice, thanks! I think this is a step towards #106, though maybe we eventually want to use kebab-case names rather than CamelCase

@ZedThree ZedThree merged commit 56be6ea into rule-selector Nov 13, 2024
22 checks passed
@ZedThree ZedThree deleted the rule-selector-explain-bug-fix branch November 13, 2024 16:44
@ZedThree ZedThree added the bug Something isn't working label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants