Skip to content

Commit 90de0d0

Browse files
committed
build: add devenv
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
1 parent dd3baff commit 90de0d0

File tree

7 files changed

+178
-0
lines changed

7 files changed

+178
-0
lines changed

‎.envrc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
export DIRENV_WARN_TIMEOUT=20s
4+
5+
eval "$(devenv direnvrc)"
6+
7+
use devenv

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Devenv
2+
/.devenv*
3+
/.direnv/
4+
devenv.local.nix
5+
.pre-commit-config.yaml
6+
17
# Compiled Object files, Static and Dynamic libs (Shared Objects)
28
*.o
39
*.a

‎README.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,31 @@ the code for a complete set.
7474
cast.ToInt(eight) // 8
7575
cast.ToInt(nil) // 0
7676

77+
## Development
78+
79+
The project uses [just](https://just.systems/) to run development tasks.
80+
81+
> [!NOTE]
82+
> For an optimal developer experience, it is recommended to install [devenv](https://devenv.sh/) and [direnv](https://direnv.net/docs/installation.html).
83+
84+
Run the test suite:
85+
86+
```shell
87+
just test
88+
```
89+
90+
Run linters:
91+
92+
```shell
93+
just lint
94+
```
95+
96+
Some linter violations can automatically be fixed:
97+
98+
```shell
99+
just fmt
100+
```
101+
77102
## License
78103

79104
The project is licensed under the [MIT License](LICENSE).

‎devenv.lock‎

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1760162706,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "0d5ad578728fe4bce66eb4398b8b1e66deceb4e4",
10+
"type": "github"
11+
},
12+
"original": {
13+
"dir": "src/modules",
14+
"owner": "cachix",
15+
"repo": "devenv",
16+
"type": "github"
17+
}
18+
},
19+
"flake-compat": {
20+
"flake": false,
21+
"locked": {
22+
"lastModified": 1747046372,
23+
"owner": "edolstra",
24+
"repo": "flake-compat",
25+
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
26+
"type": "github"
27+
},
28+
"original": {
29+
"owner": "edolstra",
30+
"repo": "flake-compat",
31+
"type": "github"
32+
}
33+
},
34+
"git-hooks": {
35+
"inputs": {
36+
"flake-compat": "flake-compat",
37+
"gitignore": "gitignore",
38+
"nixpkgs": [
39+
"nixpkgs"
40+
]
41+
},
42+
"locked": {
43+
"lastModified": 1759523803,
44+
"owner": "cachix",
45+
"repo": "git-hooks.nix",
46+
"rev": "cfc9f7bb163ad8542029d303e599c0f7eee09835",
47+
"type": "github"
48+
},
49+
"original": {
50+
"owner": "cachix",
51+
"repo": "git-hooks.nix",
52+
"type": "github"
53+
}
54+
},
55+
"gitignore": {
56+
"inputs": {
57+
"nixpkgs": [
58+
"git-hooks",
59+
"nixpkgs"
60+
]
61+
},
62+
"locked": {
63+
"lastModified": 1709087332,
64+
"owner": "hercules-ci",
65+
"repo": "gitignore.nix",
66+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
67+
"type": "github"
68+
},
69+
"original": {
70+
"owner": "hercules-ci",
71+
"repo": "gitignore.nix",
72+
"type": "github"
73+
}
74+
},
75+
"nixpkgs": {
76+
"locked": {
77+
"lastModified": 1758532697,
78+
"owner": "cachix",
79+
"repo": "devenv-nixpkgs",
80+
"rev": "207a4cb0e1253c7658c6736becc6eb9cace1f25f",
81+
"type": "github"
82+
},
83+
"original": {
84+
"owner": "cachix",
85+
"ref": "rolling",
86+
"repo": "devenv-nixpkgs",
87+
"type": "github"
88+
}
89+
},
90+
"root": {
91+
"inputs": {
92+
"devenv": "devenv",
93+
"git-hooks": "git-hooks",
94+
"nixpkgs": "nixpkgs",
95+
"pre-commit-hooks": [
96+
"git-hooks"
97+
]
98+
}
99+
}
100+
},
101+
"root": "root",
102+
"version": 7
103+
}

‎devenv.nix‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{ pkgs, ... }:
2+
3+
{
4+
languages = {
5+
go = {
6+
enable = true;
7+
package = pkgs.go_1_25;
8+
};
9+
};
10+
11+
packages = with pkgs; [
12+
just
13+
golangci-lint
14+
];
15+
}

‎devenv.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
2+
inputs:
3+
nixpkgs:
4+
url: github:cachix/devenv-nixpkgs/rolling

‎justfile‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[private]
2+
default:
3+
just --list
4+
5+
# run all checks
6+
check: test lint
7+
8+
# run tests
9+
test:
10+
go test -shuffle on -race -v ./...
11+
12+
# run linter
13+
lint:
14+
golangci-lint run
15+
16+
# format code
17+
fmt:
18+
golangci-lint fmt

0 commit comments

Comments
 (0)