zbuild format now sorts imports.

This commit is contained in:
Filipe Rodrigues 2024-07-23 17:27:59 +01:00
parent b9c964ce4c
commit a6ddb2854b
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU
10 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,5 @@
[tool.ruff.lint]
extend-select = ["I"]
ignore = ["E731"]
[tool.ruff.format]

View File

@ -43,6 +43,10 @@ def main(_args):
print(f"Prettier ({len(prettier_deps)} files)")
subprocess.run(["prettier", "--write"] + prettier_deps, check=True)
print(f"ruff ({len(python_deps)} files)")
# Note: `ruff format` doesn't sort imports, so we need to do that with `check`.
subprocess.run(
["ruff", "check", "--select", "I", "--fix"] + python_deps, check=True
)
subprocess.run(["ruff", "format"] + python_deps, check=True)

View File

@ -4,6 +4,7 @@ Generates dependencies for the format rule.
# Imports
import argparse
import format_all

View File

@ -3,8 +3,8 @@ Generates dependencies for a `psx` `ISO` file.
"""
# Imports
import xml.etree.ElementTree as ET
import argparse
import xml.etree.ElementTree as ET
def main(args):

View File

@ -4,8 +4,9 @@ Calls the `ld` linker using a `toml` manifest
# Import
import argparse
from pathlib import Path
import subprocess
from pathlib import Path
import toml
import util

View File

@ -5,6 +5,7 @@ Generates dependencies for creating an `elf` from a `toml` manifest.
# Import
import argparse
from pathlib import Path
import toml
import util

View File

@ -4,10 +4,11 @@ Calls the `raw_exe` linker using a `toml` manifest
# Import
import argparse
from pathlib import Path
import subprocess
import shutil
import os
import shutil
import subprocess
from pathlib import Path
import toml
import util

View File

@ -5,6 +5,7 @@ Generates dependencies for creating a `raw_exe` from a `toml` manifest.
# Import
import argparse
from pathlib import Path
import toml
import util

View File

@ -4,6 +4,7 @@ Processes a path
# Import
import argparse
import util

View File

@ -6,9 +6,9 @@ import argparse
from dataclasses import dataclass
from pathlib import Path
from PIL import Image
import util
import toml
import util
from PIL import Image
@dataclass