Skip to content

Commit

Permalink
chore: precommit and spellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed Nov 24, 2024
1 parent e7fcc78 commit 155f057
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:

- name: 'Install devenv.sh'
run: nix profile install nixpkgs#devenv

- name: 'Spellcheck'
run: typos

- name: 'Format'
run: |
Expand Down
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
._*


# Added by cargo

/target
_
.env
!.env.example
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"nix.serverSettings": {
"nixd": {
"formatting": {
"command": ["nixfmt", "--width=100"]
"command": [
"nixfmt",
"--width=100"
]
}
}
},
Expand Down
15 changes: 12 additions & 3 deletions biome.json → biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
"useIgnoreFile": true
},
"files": {
"include": ["*.json", "*.jsonc"],
"ignore": ["/nix/store/*"]
"include": [
"*.json",
"*.jsonc"
],
"ignore": [
"/nix/store/*"
]
},
"formatter": {
"enabled": true,
Expand All @@ -31,7 +36,11 @@
"allowTrailingCommas": true
},
"formatter": {
"enabled": true
// hack in order to have one item per line in json/jsonc files
"lineWidth": 1,
"enabled": true,
"indentWidth": 2,
"indentStyle": "space"
}
}
}
7 changes: 4 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
packages = forEachSystem (system: {
devenv-up = self.devShells.${system}.default.config.procfileScript;
packages.${system}.devenv-test = self.devShells.${system}.default.config.test;

});
devShells = forEachSystem (
system:
Expand All @@ -40,7 +39,9 @@
inherit inputs pkgs;
modules = [
{
enterShell = '''';
enterShell = ''
echo ""
'';

# https://devenv.sh/reference/options/
scripts = import ./tasks.nix;
Expand Down Expand Up @@ -73,6 +74,7 @@
direnv
deadnix
nixfmt-rfc-style
# Node.js for taplo
nodePackages_latest.nodejs
];
}
Expand All @@ -86,5 +88,4 @@
extra-substituters = "https://devenv.cachix.org";
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
};

}
9 changes: 9 additions & 0 deletions tasks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
cargo clippy --all-targets --all-features -- -A clippy::pedantic
deadnix --no-lambda-pattern-names && statix check .
'';
spellcheck.exec = ''
typos
'';
precommit.exec = ''
fmt
lint
spellcheck
build-all
'';
# options:
# $WORKSPACE
build.exec = ''
Expand Down

0 comments on commit 155f057

Please sign in to comment.