use ruff for py

This commit is contained in:
EdenQwQ 2025-03-21 17:25:44 +08:00
parent e3057eeb07
commit 31145354fb
4 changed files with 5 additions and 8 deletions

View file

@ -20,7 +20,7 @@
treefmt = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.black.enable = true;
programs.ruff-format.enable = true;
programs.prettier.enable = true;
programs.beautysh.enable = true;
programs.toml-sort.enable = true;

View file

@ -56,7 +56,7 @@ matugen_output = subprocess.run(
colors = json.loads(matugen_output)["colors"][polarity]
base16_colors = {
name: f'"{colors[hex].strip("\'")}"' for name, hex in base16_map.items()
name: f'"{colors[hex].strip("'")}"' for name, hex in base16_map.items()
}
yaml_content = f"""system: "base16"
@ -64,9 +64,7 @@ name: "{name}"
author: "matugen"
variant: "{polarity}"
palette:
""" + "\n".join(
[f" {k}: {v}" for k, v in base16_colors.items()]
)
""" + "\n".join([f" {k}: {v}" for k, v in base16_colors.items()])
with open(output, "w") as f:
f.write(yaml_content)

View file

@ -454,7 +454,6 @@ def closest_match(color: str, palette: Dict[str, Lab]) -> str:
min_distance = float("inf")
for entry in palette:
# Prior dictionary lookup and update.
lab_color = hex_to_lab_dict.get(color)

View file

@ -27,7 +27,7 @@
};
};
servers = {
pyright.enable = true;
ruff.enable = true;
lua_ls.enable = true;
bashls.enable = true;
nixd = {
@ -92,7 +92,7 @@
"injected"
];
yaml = [ "yamlfmt" ];
python = [ "black" ];
python = [ "ruff" ];
tex = [ "latexindent" ];
};
formatters = {