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