Skip to content

Commit 5e6955e

Browse files
authored
Merge pull request #173 from maxmind/greg/eng-4369
ENG-4369: Update golangci-lint to 2.11.3 via mise
2 parents 0087c5d + 556d536 commit 5e6955e

File tree

8 files changed

+359
-96
lines changed

8 files changed

+359
-96
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
name: golangci-lint
1+
name: precious
22

33
on:
44
push:
55
pull_request:
66
schedule:
7-
- cron: "4 10 * * SUN"
7+
- cron: '4 10 * * SUN'
88

99
permissions: {}
1010

1111
jobs:
12-
golangci:
12+
precious:
1313
name: lint
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
with:
1818
persist-credentials: false
19-
- name: golangci-lint
20-
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # 9.2.0
19+
- name: Setup mise
20+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
2121
with:
22-
version: latest
22+
cache: true
23+
- name: Run precious lint
24+
run: precious lint --all

.precious.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
exclude = [
2+
".git",
3+
]
4+
5+
[commands.golangci-lint-fmt]
6+
type = "both"
7+
cmd = ["golangci-lint", "fmt"]
8+
lint-flags = "--diff"
9+
ok-exit-codes = 0
10+
invoke = "once"
11+
include = ["**/*.go"]
12+
13+
[commands.golangci-lint]
14+
type = "both"
15+
cmd = ["golangci-lint", "run"]
16+
tidy-flags = ["--fix"]
17+
ok-exit-codes = 0
18+
ignore-stderr = ".*"
19+
invoke = "once"
20+
path-args = "dir"
21+
include = ["**/*.go"]
22+
23+
[commands.prettier-markdown]
24+
type = "both"
25+
cmd = ["prettier", "--prose-wrap", "always"]
26+
lint-flags = ["--check"]
27+
tidy-flags = ["--write"]
28+
path-args = "absolute-file"
29+
include = "**/*.md"
30+
ok-exit-codes = 0

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"proseWrap": "always",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"useTabs": false
6+
}

CHANGELOG.md

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,54 @@
22

33
## 2.0.0 (2025-11-12)
44

5-
* **BREAKING CHANGE**: Networks with empty map or empty array data are now
6-
skipped by default. This makes the output cleaner when working with
7-
databases that use empty values for networks without meaningful data (e.g.,
8-
public IPs in some databases). Use the new `-include-empty-values` flag to
9-
include these networks in the output.
10-
* Added `-include-empty-values` flag to optionally include networks whose data
5+
- **BREAKING CHANGE**: Networks with empty map or empty array data are now
6+
skipped by default. This makes the output cleaner when working with databases
7+
that use empty values for networks without meaningful data (e.g., public IPs
8+
in some databases). Use the new `-include-empty-values` flag to include these
9+
networks in the output.
10+
- Added `-include-empty-values` flag to optionally include networks whose data
1111
is an empty map or empty array.
1212

1313
## 2.0.0-beta.2 (2025-03-11)
1414

15-
* Fixes for the release scripts. No other changes.
15+
- Fixes for the release scripts. No other changes.
1616

1717
## 2.0.0-beta.1 (2025-03-11)
1818

19-
* The default output format is now YAML. This was done to improve the
20-
readability when using the tool as a standalone utility for doing lookups
21-
in an MMDB database. Use the `-jsonl` flag to output as JSONL instead.
22-
* When outputting as JSON, we now use JSONL. There is one JSON object per
23-
line.
24-
* The output format has been flattened. Each record that is output now
25-
contains the following keys: `database_path`, `requested_lookup`,
26-
`network`, and `record`. This allows for efficient streaming of large
27-
lookups, makes the key naming more consistent, and reduces the depth of
28-
the data structure.
29-
* You may now use a glob for the `-db` argument. If there are multiple
30-
matches, it will be treated as if multiple `-db` arguments were provided.
31-
Note that you must quote the parameter when using globs to prevent the
32-
shell's globbing from interfering. See the [pattern syntax](https://pkg.go.dev/path#Match)
33-
* The following flags were added:
34-
* `-include-networks-without-data` - include networks without any data in
35-
the database in the output.
36-
* `-include-build-time` - include the build time from the database's
37-
metadata in the output.
38-
* This repo no longer provides a public Go API. It is only intended to be
39-
used as a CLI program.
19+
- The default output format is now YAML. This was done to improve the
20+
readability when using the tool as a standalone utility for doing lookups in
21+
an MMDB database. Use the `-jsonl` flag to output as JSONL instead.
22+
- When outputting as JSON, we now use JSONL. There is one JSON object per line.
23+
- The output format has been flattened. Each record that is output now contains
24+
the following keys: `database_path`, `requested_lookup`, `network`, and
25+
`record`. This allows for efficient streaming of large lookups, makes the key
26+
naming more consistent, and reduces the depth of the data structure.
27+
- You may now use a glob for the `-db` argument. If there are multiple matches,
28+
it will be treated as if multiple `-db` arguments were provided. Note that you
29+
must quote the parameter when using globs to prevent the shell's globbing from
30+
interfering. See the [pattern syntax](https://pkg.go.dev/path#Match)
31+
- The following flags were added:
32+
- `-include-networks-without-data` - include networks without any data in the
33+
database in the output.
34+
- `-include-build-time` - include the build time from the database's metadata
35+
in the output.
36+
- This repo no longer provides a public Go API. It is only intended to be used
37+
as a CLI program.
4038

4139
## 0.2.0 (2024-01-10)
4240

43-
* Don't escape `&`, `<`, and `>` in JSON output
44-
* Skip aliased IPv6 networks by default
45-
* Build and test with Go 1.21
46-
* Remove deprecated use of ioutil and pkg/errors
47-
* Update dependencies
48-
* Update documentation
41+
- Don't escape `&`, `<`, and `>` in JSON output
42+
- Skip aliased IPv6 networks by default
43+
- Build and test with Go 1.21
44+
- Remove deprecated use of ioutil and pkg/errors
45+
- Update dependencies
46+
- Update documentation
4947

5048
## 0.1.1 (2020-02-18)
5149

52-
* Fix release config
53-
* Add release instructions
50+
- Fix release config
51+
- Add release instructions
5452

5553
## 0.1.0 (2020-02-18)
5654

57-
* Initial beta release
55+
- Initial beta release

README.dev.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# Prereqs
22

3-
* You must have the [GitHub CLI tool (gh)](https://cli.github.com/)
4-
installed, in your path, and logged into an account that can
5-
make GitHub releases on the repo.
6-
* Your environment also must have `bash`, `git` and `sed` available.
3+
- You must have the [GitHub CLI tool (gh)](https://cli.github.com/) installed,
4+
in your path, and logged into an account that can make GitHub releases on the
5+
repo.
6+
- Your environment also must have `bash`, `git` and `sed` available.
77

88
# Releasing
99

10-
* Review open issues and PRs to see if anything needs to be addressed
11-
before release.
12-
* Create a branch e.g. `horgh/release` and switch to it.
13-
* `main` is protected.
14-
* Set the release version and release date in `CHANGELOG.md`. Be sure
15-
the version follows [Semantic Versionsing](https://semver.org/).
16-
* Mention recent changes if needed.
17-
* Commit these changes.
18-
* Run `dev-bin/release.sh`.
19-
* You might need to initialize/update submodules to successfully run tests,
10+
- Review open issues and PRs to see if anything needs to be addressed before
11+
release.
12+
- Create a branch e.g. `horgh/release` and switch to it.
13+
- `main` is protected.
14+
- Set the release version and release date in `CHANGELOG.md`. Be sure the
15+
version follows [Semantic Versionsing](https://semver.org/).
16+
- Mention recent changes if needed.
17+
- Commit these changes.
18+
- Run `dev-bin/release.sh`.
19+
- You might need to initialize/update submodules to successfully run tests,
2020
eg. `git submodule update --init --recursive`.
21-
* Verify the release on the GitHub Releases page.
22-
* If everything goes well, the authorized releasers will receive an email
23-
to review the pending deployment. If you are an authorized releaser,
24-
you will need to approve the release deployment run. If you are not,
25-
you will have to wait for an authorized releaser to do so.
26-
* Make a PR and get it merged.
21+
- Verify the release on the GitHub Releases page.
22+
- If everything goes well, the authorized releasers will receive an email to
23+
review the pending deployment. If you are an authorized releaser, you will
24+
need to approve the release deployment run. If you are not, you will have to
25+
wait for an authorized releaser to do so.
26+
- Make a PR and get it merged.

0 commit comments

Comments
 (0)