nix: migrate to 'ruff' formatting
Having just the one tool is better. Incidentally, this fixes the ternary formatting, which was messed up in recent `black` versions.
This commit is contained in:
parent
94befa4d1b
commit
43650ade44
|
@ -1,2 +0,0 @@
|
|||
[settings]
|
||||
profile=black
|
|
@ -41,7 +41,6 @@ def update(grid: Grid) -> Grid:
|
|||
|
||||
|
||||
def solve(grid: Grid) -> int:
|
||||
|
||||
for __ in range(6):
|
||||
grid = update(grid)
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ def update(grid: Grid) -> Grid:
|
|||
|
||||
|
||||
def solve(grid: Grid) -> int:
|
||||
|
||||
for __ in range(6):
|
||||
grid = update(grid)
|
||||
|
||||
|
|
|
@ -63,7 +63,9 @@ def solve(input: List[str]) -> int:
|
|||
(
|
||||
"v"
|
||||
if Point(x, y) in map.south
|
||||
else ">" if Point(x, y) in map.east else "."
|
||||
else ">"
|
||||
if Point(x, y) in map.east
|
||||
else "."
|
||||
)
|
||||
for y in range(map.dimensions.y)
|
||||
)
|
||||
|
|
|
@ -8,7 +8,6 @@ FileSystem = dict[str, Union[int, "FileSystem"]]
|
|||
|
||||
def solve(input: list[str]) -> int:
|
||||
def build_tree(input: list[str], i: int = 0) -> tuple[FileSystem, int]:
|
||||
|
||||
fs: FileSystem = {}
|
||||
|
||||
while i < len(input):
|
||||
|
|
|
@ -8,7 +8,6 @@ FileSystem = dict[str, Union[int, "FileSystem"]]
|
|||
|
||||
def solve(input: list[str]) -> int:
|
||||
def build_tree(input: list[str], i: int = 0) -> tuple[FileSystem, int]:
|
||||
|
||||
fs: FileSystem = {}
|
||||
|
||||
while i < len(input):
|
||||
|
|
15
flake.nix
15
flake.nix
|
@ -39,17 +39,13 @@
|
|||
src = self;
|
||||
|
||||
hooks = {
|
||||
black = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
isort = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nixpkgs-fmt = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
ruff-format = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -57,12 +53,11 @@
|
|||
devShell = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
(python3.withPackages (ps: with ps; [
|
||||
black
|
||||
isort
|
||||
mypy
|
||||
z3
|
||||
]))
|
||||
pyright
|
||||
ruff
|
||||
];
|
||||
|
||||
inherit (self.checks.${system}.pre-commit) shellHook;
|
||||
|
|
Loading…
Reference in a new issue