Hacker News new | ask | show | jobs
by omoikane 679 days ago
> wrote the numbers in decimal

Maybe they just didn't want the checker to flag itself.

I remember there was a similar check inside Google, where any file containing the words "DO NOT SUBMIT" will cause the presubmit check to fail. Naturally the presubmit checker needs to look for that string, but it couldn't trivially include the string as-is because that would prevent the presubmit checker from being submitted.

(Motivation for something like this is that if you inserted some extra logging statements or similar for debugging, you would add "DO NOT SUBMIT" in nearby comments, so that you will remember to remove them later).

2 comments

It's also fun if you want to include that string in a template file so that users of the template don't forget to fill in the template before submitting.
But it's clippy, you can just annotate it with an #[allow(problematic_constants)]