Skip to content

Commit 82a88c7

Browse files
Add more git-hooks to devenv.nix (#699)
Inspired by the current hooks in https://github.com/crystal-lang/crystal/blob/388b48edc8095de8fd07046c45a2fe48844f5136/devenv.nix
1 parent 9eacea0 commit 82a88c7

File tree

11 files changed

+109
-24
lines changed

11 files changed

+109
-24
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
schedule:
77
- cron: "0 6 * * 1" # Every monday 6 AM
88

9+
permissions: {}
10+
911
jobs:
1012
test:
1113
strategy:
@@ -29,7 +31,7 @@ jobs:
2931
git config --global core.autocrlf false
3032
3133
- name: Install Crystal
32-
uses: oprypin/install-crystal@v1
34+
uses: crystal-lang/install-crystal@v1
3335
with:
3436
crystal: ${{ matrix.crystal }}
3537

@@ -51,6 +53,8 @@ jobs:
5153

5254
- name: Download source
5355
uses: actions/checkout@v6
56+
with:
57+
persist-credentials: false
5458

5559
- name: Build
5660
run: make -f ${{ runner.os == 'Windows' && 'Makefile.win' || 'Makefile' }}

.github/workflows/docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ jobs:
2222
steps:
2323
- name: Download source
2424
uses: actions/checkout@v6
25+
with:
26+
persist-credentials: false
2527
- name: Build manpages
26-
uses: Analog-inc/asciidoctor-action@v1.3.2
28+
uses: Analog-inc/asciidoctor-action@328aa83fd20efb2e8899a34716db60c9ddf2d9a0 # v1.3.2
2729
with:
2830
shellcommand: "make -B manpages SOURCE_DATE_EPOCH=\"$(date +%s --utc --date \"$(grep -m1 -o -E 'Date: .*' man/shard.yml.5 | cut -d' ' -f2)\")\""
2931
- name: Ensure no changes
30-
run: git diff --exit-code || echo '`make manpages` produced changes. Please rebuild the docs.'
32+
run: git diff --exit-code || echo "\`make manpages\` produced changes. Please rebuild the docs."

.github/zizmor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
rules:
2+
unpinned-uses:
3+
config:
4+
policies:
5+
actions/*: ref-pin
6+
crystal-lang/*: ref-pin

.markdownlint.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
default: true
2+
3+
heading-style: "setext"
4+
5+
no-inline-html: false
6+
line-length: false
7+
8+
ol-prefix:
9+
style: "ordered"
10+
ul-style:
11+
style: "dash"
12+
ul-indent:
13+
indent: 2
14+
15+
no-blanks-blockquote: false
16+
17+
emphasis-style:
18+
style: "underscore"
19+
strong-style:
20+
style: "asterisk"
21+
22+
no-duplicate-heading:
23+
siblings_only: true
24+
no-bare-urls: false
25+
26+
fenced-code-language: false
27+
commands-show-output: false
28+
29+
first-line-h1:
30+
front_matter_title: "^\\s*(page_)?title\\s*[:=]"
31+
exclude:
32+
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
33+
34+
no-alt-text: false
35+
36+
hard_tab:
37+
code_blocks: false

.markdownlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/lib/

CHANGELOG.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
### Infrastructure
5656

57-
* Changelog for 0.19.1 ([#666], thanks @straight-shoota)
57+
- Changelog for 0.19.1 ([#666], thanks @straight-shoota)
5858

5959
[#666]: https://github.com/crystal-lang/shards/pull/666
6060

@@ -194,10 +194,10 @@
194194

195195
### Infrastructure
196196

197-
- *(ci)* Ensure manpages are generated with no diff ([#594](https://github.com/crystal-lang/shards/pull/594), thanks @straight-shoota)
198-
- *(ci)* Upgrade xcode version on circleci ([#603](https://github.com/crystal-lang/shards/pull/603), thanks @straight-shoota)
199-
- *(ci)* Pin GHA runner versions ([#604](https://github.com/crystal-lang/shards/pull/604), thanks @straight-shoota)
200-
- *(ci)* Pin `Analog-inc/asciidoctor-action` version ([#602](https://github.com/crystal-lang/shards/pull/602), thanks @straight-shoota)
197+
- _(ci)_ Ensure manpages are generated with no diff ([#594](https://github.com/crystal-lang/shards/pull/594), thanks @straight-shoota)
198+
- _(ci)_ Upgrade xcode version on circleci ([#603](https://github.com/crystal-lang/shards/pull/603), thanks @straight-shoota)
199+
- _(ci)_ Pin GHA runner versions ([#604](https://github.com/crystal-lang/shards/pull/604), thanks @straight-shoota)
200+
- _(ci)_ Pin `Analog-inc/asciidoctor-action` version ([#602](https://github.com/crystal-lang/shards/pull/602), thanks @straight-shoota)
201201

202202
## [0.17.3] (2023-04-07)
203203

@@ -279,7 +279,7 @@
279279

280280
- Escape automatic ligatures in AsciiDoc ([#489](https://github.com/crystal-lang/shards/pull/489), thanks @elebow)
281281
- Fix links in README ([#500](https://github.com/crystal-lang/shards/pull/500), [#483](https://github.com/crystal-lang/shards/pull/483), thanks @szabgab, @kimburgess)
282-
- Correct list identation in shard.yml.adoc ([#492](https://github.com/crystal-lang/shards/pull/492/files), thanks @elebow)
282+
- Correct list indentation in shard.yml.adoc ([#492](https://github.com/crystal-lang/shards/pull/492/files), thanks @elebow)
283283
- Add getting started section to README ([#513](https://github.com/crystal-lang/shards/pull/513), thanks @straight-shoota)
284284

285285
## [0.14.1] (2021-03-10)
@@ -381,7 +381,7 @@
381381

382382
### Features
383383

384-
- **(breaking-change)** Use `crystal:` property to filter candidates version. ([#395](https://github.com/crystal-lang/shards/pull/395), thanks @waj, @bcardiff)
384+
- **(breaking-change)** Use `crystal:` property to filter candidates version. ([#395](https://github.com/crystal-lang/shards/pull/395), thanks @waj, @bcardiff)
385385
- Introduce `shard.lock` 2.0 format, run `shards install` to migrate. ([#349](https://github.com/crystal-lang/shards/pull/349), [#400](https://github.com/crystal-lang/shards/pull/400), thanks @waj)
386386
- Support intersection in requirements `version: >= 1.0.0, < 2.0`. ([#394](https://github.com/crystal-lang/shards/pull/394), thanks @waj)
387387
- Install dependencies in reverse topological order. ([#369](https://github.com/crystal-lang/shards/pull/369), thanks @waj)
@@ -458,6 +458,7 @@
458458
[0.9.0.rc1]: https://github.com/crystal-lang/shards/releases/0.9.0.rc1
459459

460460
Breaking changes:
461+
461462
- Dependency solver was overhauled;
462463
- Git tag refs that match a version number are now an actual version (i.e.
463464
`tag: v1.0.0` is converted to `version: 1.0.0`).
@@ -468,10 +469,10 @@ Breaking changes:
468469
version if possible;
469470
- Add `--local` argument to use the cache as-is, allowing to skip git fetches
470471
when you know the cache is up-to-date;
471-
- Add the *outdated* command to list dependencies that could be updated
472+
- Add the _outdated_ command to list dependencies that could be updated
472473
(matching constraints) as well as their latest version; including pre-release
473474
versions on demand.
474-
- Add the *lock* command that behaves like the *install* and *update* commands
475+
- Add the _lock_ command that behaves like the _install_ and _update_ commands
475476
but that only creates a lockfile, and doesn't install anything.
476477

477478
### Fixes
@@ -485,6 +486,7 @@ Breaking changes:
485486
[0.9.0.beta]: https://github.com/crystal-lang/shards/releases/0.9.0.beta
486487

487488
Breaking changes:
489+
488490
- A `shard.yml` spec is now required in libraries.
489491
- Drop support for obsolete Projectfile.
490492

@@ -575,6 +577,7 @@ Breaking changes:
575577
- Shorthand for gitlab.com dependencies
576578

577579
Breaking Changes:
580+
578581
- Dependencies are installed in the `lib` directory
579582
- Dependencies are now fully installed, instead of merely the `src` folder
580583
- `postinstall` scripts are now executed from the root of the dependency,
@@ -674,6 +677,7 @@ Breaking Changes:
674677
[0.5.0]: https://github.com/crystal-lang/shards/releases/0.5.0
675678

676679
Breaking Change:
680+
677681
- renamed `--no-colors` option as `--no-color` to match crystal
678682

679683
### Features
@@ -701,11 +705,12 @@ Breaking Change:
701705

702706
### Features
703707

704-
- lock resolved versions for indempotent installs across computers, see #27
708+
- lock resolved versions for idempotent installs across computers, see #27
705709
- `--production` parameter to skip development dependencies
706710
- postintall hook to run a command after installing a dependency, see #19
707711

708712
Breaking Changes:
713+
709714
- dropped support for custom dependency groups (but kept `development_dependencies`), see #27
710715

711716
### Fixes

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ prefixed with a `v`. Examples: `v1.2.3`, `v2.0.0-rc1` or `v2017.04.1`.
3333
Please see the [SPEC](docs/shard.yml.adoc) for more details about the
3434
`shard.yml` format.
3535

36-
3736
## Install
3837

3938
Shards is usually distributed with Crystal itself (e.g. Homebrew and Debian
@@ -62,12 +61,12 @@ Happy Hacking!
6261

6362
These requirements are only necessary for compiling Shards.
6463

65-
* Crystal
64+
- Crystal
6665

6766
Please refer to <https://crystal-lang.org/install/> for
6867
instructions for your operating system.
6968

70-
* libyaml
69+
- libyaml
7170

7271
On Debian/Ubuntu Linux you may install the `libyaml-dev` package.
7372

@@ -76,7 +75,7 @@ These requirements are only necessary for compiling Shards.
7675
variable (eg: `export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"`).
7776
Please adjust the path per your Homebrew installation.
7877

79-
* [asciidoctor](https://asciidoctor.org/)
78+
- [asciidoctor](https://asciidoctor.org/)
8079

8180
Needed for building manpages.
8281

@@ -86,15 +85,17 @@ It is strongly recommended to use `make` for building shards and developing it.
8685
The [`Makefile`](./Makefile) contains recipes for compiling and testing.
8786

8887
Run `make bin/shards` to build the binary.
89-
* `release=1` for a release build (applies optimizations)
90-
* `static=1` for static linking (only works with musl-libc)
91-
* `debug=1` for full symbolic debug info
88+
89+
- `release=1` for a release build (applies optimizations)
90+
- `static=1` for static linking (only works with musl-libc)
91+
- `debug=1` for full symbolic debug info
9292

9393
Run `make install` to install the binary. Target path can be adjusted with `PREFIX` (default: `PREFIX=/usr/bin`).
9494

9595
Run `make test` to run the test suites:
96-
* `make test_unit` runs unit tests (`./spec/unit`)
97-
* `make test_integration` runs integration tests (`./spec/integration`) on `bin/shards`
96+
97+
- `make test_unit` runs unit tests (`./spec/unit`)
98+
- `make test_integration` runs integration tests (`./spec/integration`) on `bin/shards`
9899

99100
Run `make docs` to build the manpages.
100101

SPEC.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# `shard.yml` specification
2+
13
The documentation for `shard.yml` has moved to [`docs/shard.yml.adoc`](docs/shard.yml.adoc).

_typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[files]
2+
extend-exclude = [
3+
".git/**",
4+
"lib/**",
5+
"man/**",
6+
]

devenv.nix

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{ pkgs, lib, config, inputs, ... }:
22

33
{
4+
dotenv.enable = true;
5+
46
packages = with pkgs; [
57
# build deps
68
gnumake
@@ -20,7 +22,26 @@
2022
};
2123

2224
git-hooks.hooks = {
23-
shellcheck.enable = true;
25+
actionlint.enable = true;
26+
check-toml.enable = true;
27+
check-vcs-permalinks.enable = true;
28+
circleci.enable = true;
2429
crystal.enable = true;
30+
makefile_both = {
31+
enable = true;
32+
name = "Change both Makefile and Makefile.win";
33+
entry = ''${pkgs.runtimeShell} -c 'test "$#" -ne 1 || (echo "Changes only in $@" && false)' --'';
34+
files = "^Makefile(\.win)?$";
35+
pass_filenames = true;
36+
};
37+
markdownlint.enable = true;
38+
shellcheck = {
39+
enable = true;
40+
excludes = [
41+
".*\.zsh$"
42+
];
43+
};
44+
typos.enable = true;
45+
zizmor.enable = true;
2546
};
2647
}

0 commit comments

Comments
 (0)