Marked as helpful by the asker
Copilot completes patterns it sees in the file. Give it a better pattern to copy:
- Add a
ruffrule that fails CI:BLE001(blind except) andS110(try-except-pass). Now the suggestion cannot be merged. - Put one correct handler near the top of common modules; Copilot mirrors nearby code more than comments.
Linters beat prompts for habits.
The ruff rules are in CI now. The suggestions still appear, they just can't land. marco_py · edited
We did the same and put one properly handled error at the top of the module as an example. Copilot copies it surprisingly often. bytebarista · edited