this derivation will be built: /nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv building '/nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv' on 'ssh-ng://customer@mac02' building '/nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv' 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 (3 changed) in 6.044s treefmt-check> Error: failed to finalise formatting: formatting failures detected error: build of '/nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv' on 'ssh-ng://customer@mac02' failed: Cannot build '/nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/bf1xgbjcdkvyk7wh9ihrhxjgaxb1xbyc-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 (3 changed) in 6.044s > Error: failed to finalise formatting: formatting failures detected For full logs, run: nix log /nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv error: Cannot build '/nix/store/pz6v7h9822dspgkwbyx05icfzjg85h98-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/bf1xgbjcdkvyk7wh9ihrhxjgaxb1xbyc-treefmt-check