Enable more ruff rules for the CI
Describe the issue
The internal software pyle has some more rules activated for ruff check analysis of the code.
We should enable them in Cirq as well to enforce similar code-quality requirements.
The extra rules are (note that some may need the preview option):
- [x] "B005",
- [x] "B033",
- [ ] "C4",
- [x] "D301",
- [x] "D419",
- [x] "F602",
- [x] "F632",
- [x] "F901",
- [ ] "FURB101",
- [ ] "FURB103",
- [ ] "FURB105",
- [ ] "FURB116",
- [x] "FURB131",
- [ ] "FURB132",
- [x] "FURB136",
- [ ] "FURB142",
- [x] "FURB145",
- [x] "FURB148",
- [x] "FURB166",
- [x] "FURB167",
- [x] "FURB168",
- [x] "FURB169",
- [ ] "FURB171",
- [x] "FURB192",
- [x] "ISC",
- [x] "N804",
- [ ] "N805",
- [x] "NPY201",
- [x] "PERF101",
- [ ] "PERF102",
- [ ] "PERF402",
- [ ] "PERF403",
- [x] "PLE0302",
- [ ] "PLE1205",
- [x] "PLE1206",
- [x] "PLE1310",
- [ ] "PLR0124",
- [x] "PLR0206",
- [x] ~"PLR1701",~ note: remapped to SIM101
- [ ] "PLR1711",
- [ ] "PLR1730",
- [ ] "PLR1733",
- [x] "PLR1736",
- [ ] "PLW0120",
- [x] "PLW0245",
- [ ] "PLW0406",
- [x] "PLW1501",
- [ ] "RET507",
- [ ] "RET508",
- [ ] "RUF005",
- [x] "RUF013",
- [ ] "RUF015",
- [x] "RUF019",
- [x] "RUF027",
- [x] "RUF200",
- [ ] "SIM103",
- [ ] "SIM110",
- [ ] "SIM113",
- [ ] "SIM115",
- [x] "SIM116",
- [x] "SIM210",
- [ ] "SIM211",
- [x] "SIM222",
- [x] "SIM223",
- [ ] "SIM401",
- [x] "TID251",
- [x] "UP004",
- [x] "UP006",
- [x] "UP008",
- [x] "UP010",
- [x] "UP018",
- [x] "UP028",
- [x] "UP034",
- [x] "UP035",
- [x] "UP037",
Tell us the version of Cirq where this happens
1.6.0.dev0 at e7636e0a496f35a5feb50d492ad02e0489368410
Not an urgent issue: should we remove mention of the internal software suite in the title of this issue?
Not an urgent issue: should we remove mention of the internal software suite in the title of this issue?
I feel it is unnecessary, it is just a name.
PS: On a second thought it is not informative for external contributors so I updated the title.
Discussed in cirq-cync: any rules that are overly strict can/should be dropped.