tribuchet: building on jamie treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 PIE810 Call `startswith` once with a `tuple` --> checks/linkcheck/main.py:49:12 | 47 | continue 48 | 49 | if title.startswith("User:") or title.startswith("Talk:"): | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 50 | root.remove(page) 51 | continue | help: Merge into a single `startswith` call EXE005 Shebang should be at the beginning of the file --> modules/nixos-wiki/update-extensions.py:2:1 | 1 | #!/usr/bin/env nix-shell 2 | #!nix-shell -i python3 -p nixfmt-rfc-style python3 python3Packages.requests python3Packages.beautifulsoup4 gh | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 | import json 4 | import os | TRY002 Create your own exception --> modules/nixos-wiki/update-extensions.py:34:15 | 32 | content = soup.find(id="mw-content-text") 33 | if content and "does not exist" in content.get_text(): 34 | raise Exception( | _______________^ 35 | | f"Extension '{extension_name}' does not exist for MediaWiki version REL{mediawiki_version}" 36 | | ) | |_________^ 37 | 38 | # Look for download links - the class is now a list ['external', 'free'] | TRY002 Create your own exception --> modules/nixos-wiki/update-extensions.py:47:11 | 45 | return urllib.parse.urlparse(href) 46 | 47 | raise Exception( | ___________^ 48 | | f"Could not find download URL for extension '{extension_name}' version REL{mediawiki_version}" 49 | | ) | |_____^ FURB122 Use of `f.write` in a for loop --> modules/nixos-wiki/update-extensions.py:73:13 | 71 | r.raise_for_status() 72 | with open(local_filename, "wb") as f: 73 | / for chunk in r.iter_content(chunk_size=8192): 74 | | # If you have chunk encoded response uncomment if 75 | | # and set chunk_size parameter to None. 76 | | # if chunk: 77 | | f.write(chunk) | |______________________________^ 78 | return local_filename | help: Replace with `f.writelines` TRY002 Create your own exception --> modules/nixos-wiki/update-extensions.py:116:19 | 114 | data = response.json() 115 | if not data: 116 | raise Exception(f"No tags found for {repo}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 117 | latest_tag = data[0]["name"] 118 | return f"https://github.com/{repo}/archive/refs/tags/{latest_tag}.zip" | TRY002 Create your own exception --> modules/nixos-wiki/update-extensions.py:120:15 | 118 | return f"https://github.com/{repo}/archive/refs/tags/{latest_tag}.zip" 119 | else: 120 | raise Exception(f"Unknown extension type: {extension_type}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY002 Create your own exception --> modules/nixos-wiki/update-extensions.py:144:11 | 142 | else: 143 | return Extension(name=extension_name, hash=hash, url=download_url) 144 | raise Exception("Failed to fetch extension, see above") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY002 Create your own exception --> modules/nixos-wiki/update-extensions.py:173:11 | 171 | else: 172 | return Extension(name=extension_name, hash=hash, url=mirror_url) 173 | raise Exception("Failed to fetch extension, see above") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EXE001 Shebang is present but file is not executable --> pkgs/wiki-user-search/wiki-user-search.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | """ 3 | MediaWiki User Search Tool | Found 27 errors (17 fixed, 10 remaining). No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option). traversed 71 files emitted 55 files for processing formatted 52 files (2 changed) in 422ms Error: failed to finalise formatting: formatting failures detected