treefmt-check
checks.x86_64-linux.treefmt
· build #98
· raw
1tribuchet: hub connection lost (hub closed event stream without a result); reconnecting2tribuchet: hub connection lost (event stream: code: 'The service is currently unavailable', message: "build is no longer in flight; resubmit"); reconnecting3tribuchet: building on jamie4treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 156PIE810 Call `startswith` once with a `tuple`7 --> checks/linkcheck/main.py:49:128 |947 | continue1048 |1149 | if title.startswith("User:") or title.startswith("Talk:"):12 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^1350 | root.remove(page)1451 | continue15 |16help: Merge into a single `startswith` call1718EXE005 Shebang should be at the beginning of the file19 --> modules/nixos-wiki/update-extensions.py:2:120 |211 | #!/usr/bin/env nix-shell222 | #!nix-shell -i python3 -p nixfmt-rfc-style python3 python3Packages.requests python3Packages.beautifulsoup4 gh23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^243 | import json254 | import os26 |2728TRY002 Create your own exception29 --> modules/nixos-wiki/update-extensions.py:34:1530 |3132 | content = soup.find(id="mw-content-text")3233 | if content and "does not exist" in content.get_text():3334 | raise Exception(34 | _______________^3535 | | f"Extension '{extension_name}' does not exist for MediaWiki version REL{mediawiki_version}"3636 | | )37 | |_________^3837 |3938 | # Look for download links - the class is now a list ['external', 'free']40 |4142TRY002 Create your own exception43 --> modules/nixos-wiki/update-extensions.py:47:1144 |4545 | return urllib.parse.urlparse(href)4646 |4747 | raise Exception(48 | ___________^4948 | | f"Could not find download URL for extension '{extension_name}' version REL{mediawiki_version}"5049 | | )51 | |_____^5253FURB122 Use of `f.write` in a for loop54 --> modules/nixos-wiki/update-extensions.py:73:1355 |5671 | r.raise_for_status()5772 | with open(local_filename, "wb") as f:5873 | / for chunk in r.iter_content(chunk_size=8192):5974 | | # If you have chunk encoded response uncomment if6075 | | # and set chunk_size parameter to None.6176 | | # if chunk:6277 | | f.write(chunk)63 | |______________________________^6478 | return local_filename65 |66help: Replace with `f.writelines`6768TRY002 Create your own exception69 --> modules/nixos-wiki/update-extensions.py:116:1970 |71114 | data = response.json()72115 | if not data:73116 | raise Exception(f"No tags found for {repo}")74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^75117 | latest_tag = data[0]["name"]76118 | return f"https://github.com/{repo}/archive/refs/tags/{latest_tag}.zip"77 |7879TRY002 Create your own exception80 --> modules/nixos-wiki/update-extensions.py:120:1581 |82118 | return f"https://github.com/{repo}/archive/refs/tags/{latest_tag}.zip"83119 | else:84120 | raise Exception(f"Unknown extension type: {extension_type}")85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^8687TRY002 Create your own exception88 --> modules/nixos-wiki/update-extensions.py:144:1189 |90142 | else:91143 | return Extension(name=extension_name, hash=hash, url=download_url)92144 | raise Exception("Failed to fetch extension, see above")93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^9495TRY002 Create your own exception96 --> modules/nixos-wiki/update-extensions.py:173:1197 |98171 | else:99172 | return Extension(name=extension_name, hash=hash, url=mirror_url)100173 | raise Exception("Failed to fetch extension, see above")101 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^102103EXE001 Shebang is present but file is not executable104 --> pkgs/wiki-user-search/wiki-user-search.py:1:1105 |1061 | #!/usr/bin/env python3107 | ^^^^^^^^^^^^^^^^^^^^^^1082 | """1093 | MediaWiki User Search Tool110 |111112Found 27 errors (17 fixed, 10 remaining).113No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).114115traversed 71 files116emitted 55 files for processing117formatted 52 files (2 changed) in 404ms118Error: failed to finalise formatting: formatting failures detected