Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/golangci-lint.yml

This file was deleted.

12 changes: 8 additions & 4 deletions .github/workflows/precious.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
pull_request:

permissions: {}

jobs:
precious:
name: lint
Expand All @@ -12,9 +14,11 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install precious
run: |
curl -L https://github.com/houseabsolute/precious/releases/download/v0.10.1/precious-Linux-musl-x86_64.tar.gz | \
tar -xz -C /usr/local/bin precious

- name: Setup mise
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
with:
cache: true

- name: Run precious lint
run: precious lint --all
20 changes: 19 additions & 1 deletion .precious.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,27 @@ exclude = [

[commands.prettier-json]
type = "both"
cmd = ["npx", "-y", "--", "prettier"]
cmd = ["prettier"]
lint-flags = ["--check"]
tidy-flags = ["--write"]
path-args = "absolute-file"
include = "**/*.json"
ok_exit_codes = 0

[commands.golangci-lint-fmt]
type = "both"
cmd = ["golangci-lint", "fmt"]
lint-flags = "--diff"
ok-exit-codes = 0
invoke = "once"
include = ["**/*.go"]

[commands.golangci-lint]
type = "both"
cmd = ["golangci-lint", "run"]
tidy-flags = ["--fix"]
ok-exit-codes = 0
ignore-stderr = ".*"
invoke = "once"
path-args = "dir"
include = ["**/*.go"]
6 changes: 6 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tools]
go = "latest"
node = "latest"
golangci-lint = "latest"
"github:houseabsolute/precious" = "latest"
"npm:prettier" = "latest"
Comment on lines +2 to +6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using latest for tool versions can lead to non-reproducible builds. If a new version of a tool is released with breaking changes, it could break the development environment or CI/CD pipeline unexpectedly. It's a best practice to pin tools to specific versions to ensure everyone is using the same toolchain and that builds are deterministic.

You should replace latest with specific versions. For example:

go = "1.22.0"
node = "20.11.0"
golangci-lint = "1.56.2"
"github:houseabsolute/precious" = "0.4.0"
"npm:prettier" = "3.2.5"

Please choose the versions that are appropriate for your project.

Suggested change
go = "latest"
node = "latest"
golangci-lint = "latest"
"github:houseabsolute/precious" = "latest"
"npm:prettier" = "latest"
go = "1.22.0"
node = "20.11.0"
golangci-lint = "1.56.2"
"github:houseabsolute/precious" = "0.4.0"
"npm:prettier" = "3.2.5"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this, but we previously used the latest versions and we would need to come up with a plan to keep them up to date.

Loading