Skip to content

Conversation

stonedDiscord
Copy link
Contributor

I realize this is in direct competition with #14107, I started work on this on saturday when I posted the question if this could be automated in the Discord server.

The action will post code reviews, much like a human reviwer would.
An example can be seen here: stonedDiscord#5

I went through https://docs.mamedev.org/contributing/cxx.html to come up with these rules.
It will detect

  • Missing newline at EOF
  • Invalid UTF-8
  • Wrong type of line ending
  • Trailing whitespaces
  • Uppercase hex literals
  • Single line block comments
  • Lowercase constants
  • Uppercase functions
  • Uppercase class names
  • Uppercase Enum names

It mostly uses regex to detect those, I haven't run into any false positives yet, but I'm on the fence about dropping the constants check because it will complain about variables that someone has marked const.

@cuavas
Copy link
Member

cuavas commented Sep 2, 2025

And ironically, it’s a Python script with no final newline…

@stonedDiscord
Copy link
Contributor Author

I'm aware that I get this constantly wrong, that's why I asked and then wrote this script.
I guess I'm simply not used to that style rule and I will probably get it wrong again.
The point of the script is to let newbies like myself deal with the review bot so maintainers have more time to review PRs that are ready for merging and don't get fed up or annoyed as much.
The CI doesn't block merging, same as with human reviews.

@stonedDiscord
Copy link
Contributor Author

stonedDiscord commented Sep 2, 2025

I've changed it to use no external dependencies and to post a single review with multiple comments, fixing any rate limit issues before they appear.

I've tested the style checker against #14020 here:
stonedDiscord#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants