mirror of https://github.com/astral-sh/ruff
* Document codes.rs
* Refactor codes.rs before merging
Helper script:
```python
# %%
from pathlib import Path
codes = Path("crates/ruff/src/codes.rs").read_text().splitlines()
rules = Path("a.txt").read_text().strip().splitlines()
rule_map = {i.split("::")[-1]: i for i in rules}
# %%
codes_new = []
for line in codes:
if ", Rule::" in line:
left, right = line.split(", Rule::")
right = right[:-2]
line = left + ", " + rule_map[right] + "),"
codes_new.append(line)
# %%
Path("crates/ruff/src/codes.rs").write_text("\n".join(codes_new))
```
Co-authored-by: Jonathan Plasse <13716151+JonathanPlasse@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| benchmarks | ||
| Dockerfile.ecosystem | ||
| _utils.py | ||
| add_plugin.py | ||
| add_rule.py | ||
| check_docs_formatted.py | ||
| check_ecosystem.py | ||
| ecosystem_all_check.py | ||
| ecosystem_all_check.sh | ||
| ecosystem_all_check_entrypoint.sh | ||
| generate_known_standard_library.py | ||
| generate_mkdocs.py | ||
| pyproject.toml | ||
| transform_readme.py | ||
| update_ambiguous_characters.py | ||
| update_schemastore.py | ||