While doing edit reviews, I have often noticed that invalid edits to code are approved.
Point in case; this edit introduces two syntax errors, yet, it was approved. Only I rejected it based on being invalid, three others accepted it, and someone else rejected it based on being too minor (!!)
This is far from uncommon and happens several times a day. Other sorts of invalid edits I've encountered are:
- Changes to code style/indentation which don't objectively make the post better
- Fixes to syntax errors/logic errors (often, this is the precise problem the OP is having).
- Fixes typo/capitalization
- Other edits which change the actual meaning of the code...
When should I make edits to code? clearly states the do's & don't, but not all (new) users are aware of this, and make well-intentioned but invalid edits. I've developed some sort of sense to detect which sort (invalid) edits are likely to be approved anyway, and I go back & rollback the changes, but this is a "hack", and overrides the point of the review process.
Also makes you wonder how many of these invalid edits slip through...
Should the edit page make it clearer that edits to code should fix only very specific problems?
For editors, an extra line could be added, perhaps only for the first n edits, ugly mockup:
Or, an extra confirmation box could be down when changes to a code block are detected, another ugly mockup:
For reviewers, an extra line could also be added:
just because
or used code blocksfor emphasis
a suggested edit couldn't fix it.