Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1026 from kachick/update-nixpath
Browse files Browse the repository at this point in the history
Update nixpath
  • Loading branch information
kachick committed Jul 23, 2023
2 parents 41ac25b + 206db74 commit 07edc7e
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 29 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/ci-crystal.yml
Expand Up @@ -26,23 +26,17 @@ jobs:
- uses: actions/checkout@v3
- uses: crystal-lang/install-crystal@v1
with:
crystal: '1.8.1'
# Keep same version as used in *.nix
crystal: '1.9.0'
shards: '0.17.3'
# Need node.js to install validator. Spec includes the validator runner
- run: crystal spec --tag '~needs_npm'
lint:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache ameba
id: cache
uses: actions/cache@v3
with:
path: ./bin/ameba
key: ameba-${{ runner.os }}-crystal_1.8.1-${{ hashFiles('shard.lock') }}
- uses: crystal-lang/install-crystal@v1
with:
crystal: '1.8.1'
- run: shards install
if: steps.cache.outputs.cache-hit != 'true'
- run: make crystal-lint-check
- name: Crystal Ameba Linter
uses: crystal-ameba/github-action@v0.7.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-nix.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix-shell --run 'echo This step should be done before any other "nix-shell" steps because of measuring Nix build time'
- name: Log current versions
run: nix-shell --run 'make versions'
run: nix-shell --run 'make deps'
- run: nix-shell --run 'make setup'
- name: Run linters
run: nix-shell --run 'make check'
2 changes: 1 addition & 1 deletion .github/workflows/ci-official.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: '.node-version'
cache: npm
- run: npm ci
# renovate.json will always tested by the CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-typescript.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version-file: '.node-version'
cache: npm
- run: npm ci
- run: npx tsc
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint-common.yml
Expand Up @@ -16,6 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dprint/check@v2.2
with:
# Keep same version as used in *.nix
dprint-version: '0.37.1'

typos:
timeout-minutes: 5
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lint-definition.yml
Expand Up @@ -21,6 +21,8 @@ jobs:
- uses: actions/checkout@v3
- uses: crystal-lang/install-crystal@v1
with:
crystal: '1.8.1'
# Keep same version as used in *.nix
crystal: '1.9.0'
shards: '0.17.3'
- run: shards install --production
- run: crystal run src/cli.cr -- lint
1 change: 1 addition & 0 deletions .node-version
@@ -0,0 +1 @@
18.16.1
6 changes: 5 additions & 1 deletion .vscode/settings.json
Expand Up @@ -5,11 +5,15 @@
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
},
"[crystal]": {
"editor.defaultFormatter": "crystal-lang-tools.crystal-lang"
},
"nix.serverPath": "nil",
"nix.enableLanguageServer": true,
"nix.serverSettings": {
"nil": {
"formatting": { "command": ["nixpkgs-fmt"] }
}
}
},
"crystal-lang.server": "/nix/store/pj2wfyhfgac9lb2c9lwp85294hx4lkpg-crystalline-0.10.0/bin/crystalline"
}
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -47,7 +47,7 @@ lint-definitions:
lint-all: crystal-lint-check dprint-check lint-definitions eslint-check typos-check

crystal-lint-check: crystal-format-check
./bin/ameba --except Metrics
ameba --except Metrics

.PHONY: crystal-format-check
crystal-format-check:
Expand All @@ -62,7 +62,7 @@ lint-fix-all: crystal-lint-fix dprint-fix eslint-fix
.PHONY: crystal-lint-fix
crystal-lint-fix:
crystal tool format
./bin/ameba --except Metrics --fix
ameba --except Metrics --fix

.PHONY: eslint-check
eslint-check:
Expand All @@ -85,7 +85,7 @@ touch:
./bin/cli touch

.PHONY: versions
versions:
deps:
nix --version
node --version
crystal --version
Expand Down
13 changes: 9 additions & 4 deletions default.nix
@@ -1,14 +1,19 @@
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/e57b65abbbf7a2d5786acc86fdf56cde060ed026.tar.gz") { } }:
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/19a336ffabcd7d77cb3d55fa890ab64e7c4ac3f3.tar.gz") { } }:

pkgs.mkShell {
buildInputs = [
pkgs.nodejs-18_x
pkgs.crystal_1_8
pkgs.shards
pkgs.dprint
pkgs.nil
pkgs.nixpkgs-fmt
pkgs.pcre
pkgs.typos

# Section for crystal
pkgs.crystal
pkgs.shards
# Used in crystal
pkgs.pcre
pkgs.crystalline
pkgs.ameba
];
}
8 changes: 4 additions & 4 deletions shard.yml
Expand Up @@ -12,10 +12,10 @@ authors:
# github: will/crystal-pg
# version: "~> 0.5"

development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.4.3
# development_dependencies:
# ameba:
# github: crystal-ameba/ameba
# version: ~> 1.4.3

license: MIT

Expand Down

0 comments on commit 07edc7e

Please sign in to comment.