Skip to content

Commit 2240d7d

Browse files
committed
Run treefmt on repo
1 parent 253078c commit 2240d7d

File tree

7 files changed

+38
-19
lines changed

7 files changed

+38
-19
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
default_language_version:
44
python: python3.12
5-
65
repos:
76
- repo: https://github.com/asottile/add-trailing-comma
87
rev: v3.1.0
98
hooks:
109
- id: add-trailing-comma
11-
1210
- repo: https://github.com/pre-commit/pre-commit-hooks
1311
rev: v5.0.0
1412
hooks:
@@ -17,22 +15,19 @@ repos:
1715
- id: check-yaml
1816
- id: debug-statements
1917
- id: check-added-large-files
20-
2118
- repo: https://github.com/astral-sh/ruff-pre-commit
2219
rev: v0.9.4
2320
hooks:
2421
- id: ruff
2522
args: [--fix]
2623
- id: ruff-format
27-
2824
- repo: https://github.com/adamchainz/django-upgrade
2925
rev: 1.22.2
3026
hooks:
3127
- id: django-upgrade
3228
args: [--target-version, "5.1"] # Replace with Django version
33-
3429
- repo: https://github.com/adamchainz/djade-pre-commit
3530
rev: "1.3.2"
3631
hooks:
37-
- id: djade
38-
args: [--target-version, "5.1"] # Replace with Django version
32+
- id: djade
33+
args: [--target-version, "5.1"] # Replace with Django version

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ zcat strykeforce.sql.gz | psql -d strykeforce
1919
rclone -v sync s3://www.strykeforce.org/media/ ./media
2020
./manage.py wagtail_update_image_renditions
2121
```
22+
2223
## Server Management
2324

2425
```sh
@@ -31,7 +32,6 @@ $ nix registry add strykeforce-manage "github:strykeforce/strykeforce.org"
3132
$ nix run strykeforce-manage -- help
3233
```
3334

34-
3535
## Testing NixOS module in Container
3636

3737
```

deploy/configuration.nix

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
{ modulesPath, pkgs, ... }: {
1+
{ modulesPath, pkgs, ... }:
2+
{
23
imports = [ "${modulesPath}/virtualisation/amazon-image.nix" ];
34
ec2.hvm = true;
45

56
services.getty.autologinUser = pkgs.lib.mkDefault "root";
67

78
networking.hostName = "mercury";
8-
networking.firewall.allowedTCPPorts = [ 80 443 ];
9+
networking.firewall.allowedTCPPorts = [
10+
80
11+
443
12+
];
913

1014
systemd.services.amazon-init.enable = false;
1115

@@ -19,7 +23,11 @@
1923
];
2024
};
2125

22-
environment.systemPackages = with pkgs; [ bat htop vim ];
26+
environment.systemPackages = with pkgs; [
27+
bat
28+
htop
29+
vim
30+
];
2331
programs = {
2432
git.enable = true;
2533
vim.enable = true;

deploy/secrets.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ let
66

77
in
88
{
9-
"strykeforce_website_secrets.age".publicKeys = [ jeff mercury ];
10-
"strykeforce_s3_secrets.age".publicKeys = [ jeff mercury ];
9+
"strykeforce_website_secrets.age".publicKeys = [
10+
jeff
11+
mercury
12+
];
13+
"strykeforce_s3_secrets.age".publicKeys = [
14+
jeff
15+
mercury
16+
];
1117
}

justfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# just manual: https://just.systems/man/en/
22

33
_default:
4-
@just --list
4+
@just --list
55

66
# bootstrap the development environment
77
bootstrap: pre-commit
88

99
# open the project in Pycharm
1010
edit:
11-
pycharm .
11+
pycharm .
1212

1313
# run manage.py with command
1414
manage command:
@@ -32,7 +32,9 @@ test: (manage "test --keepdb")
3232
push:
3333
nix build --json .#venv | jq -r '.[].outputs | to_entries[].value' | cachix push strykeforce
3434
nix build --json .#static | jq -r '.[].outputs | to_entries[].value' | cachix push strykeforce
35+
3536
#
37+
3638
# update CSS
3739
update-css:
3840
npx @tailwindcss/cli --input=website/static/2767/base.css --output=website/static/2767/main.css

nix/formatter.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@ inputs.treefmt-nix.lib.mkWrapper pkgs {
77
programs.mdformat.settings.number = true;
88

99
programs.nixfmt.enable = true;
10-
programs.stylua.enable = true;
10+
programs.ruff-format.enable = true;
1111
programs.yamlfmt.enable = true;
12+
programs.just.enable = true;
13+
programs.jsonfmt.enable = true;
14+
programs.taplo.enable = true;
1215

1316
settings = {
14-
global.excludes = [ "*.{age,gif,png,svg,env,envrc,gitignore,tmTheme,sublime-syntax,theme}" ];
17+
global.excludes = [
18+
"*.{age,gif,png,svg,env,envrc,gitignore,tmTheme,sublime-syntax,theme,pickle,toml}"
19+
".idea/*"
20+
"website/static/*"
21+
"website/templates/*"
22+
".python-version"
23+
];
1524
};
1625
}

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ dev = [
3333
requires = ["hatchling"]
3434
build-backend = "hatchling.build"
3535

36-
[tool.black]
36+
[tool.ruff]
3737
line-length = 99
38-
target-version = ['py312']
3938

4039
[tool.isort]
4140
profile = "black"

0 commit comments

Comments
 (0)