Skip to content

Commit 4bbedaf

Browse files
committed
chore(CI): Add format and lint on pr
1 parent 8d6dce0 commit 4bbedaf

4 files changed

Lines changed: 42 additions & 4 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# inspired by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
2+
name: PR check
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
jobs:
7+
build:
8+
name: check
9+
permissions:
10+
contents: read
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Install Nix
14+
uses: DeterminateSystems/nix-installer-action@main
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
extra-conf: |
18+
extra-experimental-features = nix-command flakes pipe-operators
19+
- name: Set up cache
20+
uses: DeterminateSystems/magic-nix-cache-action@main
21+
- name: action
22+
uses: cachix/install-nix-action@v25
23+
with:
24+
nix_path: nixpkgs=channel:nixos-unstable
25+
- name: cache
26+
uses: cachix/cachix-action@v16
27+
with:
28+
name: dashnix
29+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
30+
- name: Linter check
31+
run: nix run --no-write-lock-file github:${{ github.repository }}/${{ github.sha }}#lint -- check
32+
- name: Format check
33+
run: nix run --no-write-lock-file github:${{ github.repository }}/${{ github.sha }}#format -- --check .
34+
- name: Build DashVim
35+
run: |
36+
nix -L build .#minimal
37+
nix -L build

config/base.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
lineNumberMode = mkDashDefault "number";
2020

21-
globals = lib.attrsets.mapAttrs (name: value: mkDashDefault value) {
21+
globals = lib.attrsets.mapAttrs (_: mkDashDefault) {
2222
fileencoding = "utf-8";
2323
spelllang = "en_us";
2424
shell = "fish";
@@ -35,7 +35,7 @@
3535
instant_username = config'.instantUsername;
3636
};
3737

38-
options = lib.attrsets.mapAttrs (name: value: mkDashDefault value) {
38+
options = lib.attrsets.mapAttrs (_: mkDashDefault) {
3939
swapfile = true;
4040
wrap = false;
4141
showmode = true;

config/keybinds.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}: {
77
vim = lib.mkIf config'.useDefaultKeybinds {
88
binds.whichKey.register =
9-
lib.attrsets.mapAttrs (_: value: mkDashDefault value) {
9+
lib.attrsets.mapAttrs (_: mkDashDefault) {
1010
"<leader><b>" = "+Buffers";
1111
"<leader>t" = "+Neotest";
1212
"<leader>c" = "+Code";

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@
8383
packages = with pkgs;
8484
[
8585
nuget
86-
inputs.statix.packages.${system}.default
8786
]
8887
++ deps;
8988
};
9089
packages = {
9190
dependencies = deps;
91+
lint = inputs.statix.packages.${system}.default;
92+
format = pkgs.alejandra;
9293
default = package.neovim;
9394
minimal = custom.neovim;
9495
docs = import ./docs {

0 commit comments

Comments
 (0)