zbuild format now sorts imports.
This commit is contained in:
parent
b9c964ce4c
commit
a6ddb2854b
@ -1,4 +1,5 @@
|
||||
[tool.ruff.lint]
|
||||
extend-select = ["I"]
|
||||
ignore = ["E731"]
|
||||
|
||||
[tool.ruff.format]
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ Generates dependencies for the format rule.
|
||||
|
||||
# Imports
|
||||
import argparse
|
||||
|
||||
import format_all
|
||||
|
||||
|
||||
|
||||
@ -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):
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ Processes a path
|
||||
|
||||
# Import
|
||||
import argparse
|
||||
|
||||
import util
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user