Skip to content

Commit f3adfb6

Browse files
authored
Merge pull request #417 from maxmind/greg/eng-4241
Fix documentation grammar, types, signatures, and add missing docs
2 parents 3eda67f + a5dd9b4 commit f3adfb6

16 files changed

Lines changed: 940 additions & 649 deletions

.github/workflows/precious.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: precious
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions: {}
8+
9+
jobs:
10+
precious:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15+
with:
16+
persist-credentials: false
17+
18+
- name: Setup mise
19+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
20+
with:
21+
cache: true
22+
23+
- name: Run precious lint
24+
run: precious lint --all

.precious.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
exclude = [
2+
".git",
3+
"maxmind-db/**",
4+
"t/libtap/**",
5+
"t/maxmind-db/**",
6+
]
7+
8+
[commands.clang-format]
9+
type = "both"
10+
cmd = ["clang-format", "-style=file"]
11+
lint-flags = ["--dry-run", "-Werror"]
12+
tidy-flags = ["-i"]
13+
path-args = "file"
14+
include = ["**/*.c", "**/*.h"]
15+
ok-exit-codes = 0
16+
17+
[commands.prettier-markdown]
18+
type = "both"
19+
cmd = ["prettier", "--prose-wrap", "always", "--print-width", "80"]
20+
lint-flags = ["--check"]
21+
tidy-flags = ["--write"]
22+
path-args = "file"
23+
include = ["**/*.md"]
24+
ok-exit-codes = 0

Changes.md

Lines changed: 307 additions & 350 deletions
Large diffs are not rendered by default.

README.dev.md

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
We release by uploading the tarball to GitHub and uploading Ubuntu PPAs.
44

55
## Creating the release tarball
6+
67
You may want to refer to the section about prerequisites.
78

8-
* Check whether there are any open issues to fix while you're doing this.
9-
* Update `Changes.md` to include specify the new version, today's date, and
10-
list relevant changes. Commit this.
11-
* Create a new branch off of the latest `main` for the release.
12-
* Run `./dev-bin/release.sh` to update various files in the distro, our
13-
GitHub pages, and creates a GitHub release with the tarball.
14-
* Check the release looks good on both GitHub and launchpad.net.
15-
* Make a pull request against `main` with the changes from the release
16-
script.
9+
- Check whether there are any open issues to fix while you're doing this.
10+
- Update `Changes.md` to specify the new version, today's date, and list
11+
relevant changes. Commit this.
12+
- Create a new branch off of the latest `main` for the release.
13+
- Run `./dev-bin/release.sh` to update various files in the distro, our GitHub
14+
pages, and creates a GitHub release with the tarball.
15+
- Check the release looks good on both GitHub and launchpad.net.
16+
- Make a pull request against `main` with the changes from the release script.
1717

1818
## PPA
1919

@@ -22,56 +22,53 @@ register a GPG key with that account. You also need to be added to the MaxMind
2222
team. Ask in the dev channel for someone to add you. See
2323
https://help.launchpad.net/Packaging/PPA for more details.
2424

25-
The PPA release script is at `dev-bin/ppa-release.sh`. Running it should
26-
guide you though the release, although it may require some changes to run on
25+
The PPA release script is at `dev-bin/ppa-release.sh`. Running it should guide
26+
you though the release, although it may require some changes to run on
2727
configurations different than Greg's machine.
2828

29-
Check whether any new Ubuntu versions need to be listed in this script
30-
before running it.
29+
Check whether any new Ubuntu versions need to be listed in this script before
30+
running it.
3131

3232
You should run it from `main`.
3333

3434
## Homebrew (optional)
3535

36-
Releasing to Homebrew is no longer required as the formulas are easily
37-
updated by the end-user using a built-in feature in the tool. These
38-
directions remain in case there is a more significant change to the
39-
build process that may require a non-trivial update to the formula or
40-
in the case where we want the Homebrew version updated promptly for
41-
some reason.
36+
Releasing to Homebrew is no longer required as the formulas are easily updated
37+
by the end-user using a built-in feature in the tool. These directions remain in
38+
case there is a more significant change to the build process that may require a
39+
non-trivial update to the formula or in the case where we want the Homebrew
40+
version updated promptly for some reason.
4241

43-
* Go to https://github.com/Homebrew/homebrew-core/edit/master/Formula/libmaxminddb.rb
44-
* Edit the file to update the url and sha256. You can get the sha256 for the
42+
- Go to
43+
https://github.com/Homebrew/homebrew-core/edit/master/Formula/libmaxminddb.rb
44+
- Edit the file to update the url and sha256. You can get the sha256 for the
4545
tarball with the `sha256sum` command line utility.
46-
* Make a commit with the summary `libmaxminddb <VERSION>`
47-
* Submit a PR with the changes you just made.
46+
- Make a commit with the summary `libmaxminddb <VERSION>`
47+
- Submit a PR with the changes you just made.
4848

4949
# Prerequisites for releasing
5050

51-
* Required packages (Ubuntu Artful): vim git-core dput build-essential
52-
autoconf automake libtool git-buildpackage libfile-slurp-perl pandoc
53-
dirmngr libfile-slurp-tiny-perl libdatetime-perl debhelper dh-autoreconf
51+
- Required packages (Ubuntu Artful): vim git-core dput build-essential autoconf
52+
automake libtool git-buildpackage libfile-slurp-perl pandoc dirmngr
53+
libfile-slurp-tiny-perl libdatetime-perl debhelper dh-autoreconf
5454
libipc-run3-perl libtest-output-perl devscripts
55-
* Install [gh](https://github.com/cli/cli/releases).
56-
* GitHub ssh key (e.g. in `~/.ssh/id_rsa`)
57-
* Git config (e.g. `~/.gitconfig`)
58-
* Import your GPG secret key (or create one if you don't have a suitable
59-
one)
60-
* `gpg --import /path/to/key`
61-
* `gpg --edit-key KEYID` and trust it ultimately
62-
* Ensure it shows with `gpg --list-secret-keys`
63-
* You need to be invited to the launchpad.net MaxMind organization on your
55+
- Install [gh](https://github.com/cli/cli/releases).
56+
- GitHub ssh key (e.g. in `~/.ssh/id_rsa`)
57+
- Git config (e.g. `~/.gitconfig`)
58+
- Import your GPG secret key (or create one if you don't have a suitable one)
59+
- `gpg --import /path/to/key`
60+
- `gpg --edit-key KEYID` and trust it ultimately
61+
- Ensure it shows with `gpg --list-secret-keys`
62+
- You need to be invited to the launchpad.net MaxMind organization on your
6463
launchpad.net account.
65-
* You need your GPG key listed on your launchpad.net account
66-
* You can add it in the web interface. It wants the output of
64+
- You need your GPG key listed on your launchpad.net account
65+
- You can add it in the web interface. It wants the output of
6766
`gpg --fingerprint`.
68-
* Part of the instructions involve having your key published on the
69-
Ubuntu keyserver:
70-
`gpg --keyserver keyserver.ubuntu.com --send-keys KEYID`
71-
* You'll get an email with an encrypted payload that you need to decrypt
72-
and follow the link to confirm it.
73-
* Ensure `dch` knows your name and email. Refer to its man page for how to
74-
tell it this. One way is to set the `DEBFULLNAME` and `DEBEMAIL`
75-
environment variables. These should match your GPG key's name and email
76-
exactly. This is what gets used in the Debian changelog as well as
77-
defines what GPG key to use.
67+
- Part of the instructions involve having your key published on the Ubuntu
68+
keyserver: `gpg --keyserver keyserver.ubuntu.com --send-keys KEYID`
69+
- You'll get an email with an encrypted payload that you need to decrypt and
70+
follow the link to confirm it.
71+
- Ensure `dch` knows your name and email. Refer to its man page for how to tell
72+
it this. One way is to set the `DEBFULLNAME` and `DEBEMAIL` environment
73+
variables. These should match your GPG key's name and email exactly. This is
74+
what gets used in the Debian changelog as well as defines what GPG key to use.

README.fuzzing.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ These tests are only meant to be run on GNU/Linux.
99
Note that in `CFLAGS` and `CXXFLAGS`, any type of sanitizers can be added.
1010

1111
- [AddressSanitizer](https://clang.llvm.org/docs/AddressSanitizer.html),
12-
[ThreadSanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html),
13-
[MemorySanitizer](https://clang.llvm.org/docs/MemorySanitizer.html),
14-
[UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html),
15-
[LeakSanitizer](https://clang.llvm.org/docs/LeakSanitizer.html).
12+
[ThreadSanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html),
13+
[MemorySanitizer](https://clang.llvm.org/docs/MemorySanitizer.html),
14+
[UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html),
15+
[LeakSanitizer](https://clang.llvm.org/docs/LeakSanitizer.html).
1616

1717
```shell
1818
$ export CC=clang
@@ -38,4 +38,5 @@ $ find ../t/maxmind-db/test-data/ -type f -size -4k -exec cp {} ./fuzz_mmdb_seed
3838
$ ./t/fuzz_mmdb fuzz_mmdb_seed/ fuzz_mmdb_seed_corpus/
3939
```
4040

41-
Here is more information about [LibFuzzer](https://llvm.org/docs/LibFuzzer.html).
41+
Here is more information about
42+
[LibFuzzer](https://llvm.org/docs/LibFuzzer.html).

README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ designed to facilitate fast lookups of IP addresses while allowing for great
66
flexibility in the type of data associated with an address.
77

88
The MaxMind DB format is an open format. The spec is available at
9-
https://maxmind.github.io/MaxMind-DB/. This spec is licensed under the
10-
Creative Commons Attribution-ShareAlike 3.0 Unported License.
9+
https://maxmind.github.io/MaxMind-DB/. This spec is licensed under the Creative
10+
Commons Attribution-ShareAlike 3.0 Unported License.
1111

1212
See https://dev.maxmind.com/ for more details about MaxMind's GeoIP2 products.
1313

@@ -23,9 +23,9 @@ This library is licensed under the Apache License, Version 2.
2323
tarballs on the [Releases](https://github.com/maxmind/libmaxminddb/releases)
2424
page (e.g. `libmaxminddb-*.tar.gz`).
2525

26-
This code is known to work with GCC 4.4+ and clang 3.2+. It should also work
27-
on other compilers that supports C99, POSIX.1-2001, and the `-fms-extensions
28-
flag` (or equivalent). The latter is needed to allow an anonymous union in a
26+
This code is known to work with GCC 4.4+ and clang 3.2+. It should also work on
27+
other compilers that support C99, POSIX.1-2001, and the `-fms-extensions flag`
28+
(or equivalent). The latter is needed to allow an anonymous union in a
2929
structure.
3030

3131
To install this code, run the following commands:
@@ -56,16 +56,16 @@ ldconfig
5656

5757
## From a GitHub "Source Code" Archive / Git Repo Clone (Achtung!)
5858

59-
**NOTE:** These instructions are for installation from the GitHub "Source
60-
Code" archives also available on the
59+
**NOTE:** These instructions are for installation from the GitHub "Source Code"
60+
archives also available on the
6161
[Releases](https://github.com/maxmind/libmaxminddb/releases) page (e.g.
62-
`X.Y.Z.zip` or `X.Y.Z.tar.gz`), as well as installation directly from a clone
63-
of the [Git repo](https://github.com/maxmind/libmaxminddb). Installation from
64-
these sources are possible but will present challenges to users not
65-
comfortable with manual dependency resolution.
62+
`X.Y.Z.zip` or `X.Y.Z.tar.gz`), as well as installation directly from a clone of
63+
the [Git repo](https://github.com/maxmind/libmaxminddb). Installation from these
64+
sources is possible but will present challenges to users not comfortable with
65+
manual dependency resolution.
6666

67-
You will need `automake`, `autoconf`, and `libtool` installed
68-
in addition to `make` and a compiler.
67+
You will need `automake`, `autoconf`, and `libtool` installed in addition to
68+
`make` and a compiler.
6969

7070
You can clone this repository and build it by running:
7171

@@ -74,8 +74,8 @@ git clone --recursive https://github.com/maxmind/libmaxminddb
7474
```
7575

7676
After cloning, run `./bootstrap` from the `libmaxminddb` directory and then
77-
follow the instructions for installing from a named release tarball as
78-
described above.
77+
follow the instructions for installing from a named release tarball as described
78+
above.
7979

8080
## Using CMake
8181

@@ -91,8 +91,8 @@ ctest -V .
9191
cmake --build . --target install
9292
```
9393

94-
When building with Visual Studio, you may build a multithreaded (MT/MTd)
95-
runtime library, using the `MSVC_STATIC_RUNTIME` setting:
94+
When building with Visual Studio, you may build a multithreaded (MT/MTd) runtime
95+
library, using the `MSVC_STATIC_RUNTIME` setting:
9696

9797
```bash
9898
cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF ..
@@ -106,8 +106,8 @@ cmake --build . --target uninstall
106106

107107
## On Ubuntu via PPA
108108

109-
MaxMind provides a PPA for recent version of Ubuntu. To add the PPA to your
110-
APT sources, run:
109+
MaxMind provides a PPA for recent version of Ubuntu. To add the PPA to your APT
110+
sources, run:
111111

112112
```bash
113113
sudo add-apt-repository ppa:maxmind/ppa
@@ -136,8 +136,8 @@ sudo port install libmaxminddb
136136

137137
# Requirements
138138

139-
libmaxminddb requires a minimum of POSIX.1-2001 support. If not specified
140-
at compilation time, it defaults to requesting POSIX.1-2008 support.
139+
libmaxminddb requires a minimum of POSIX.1-2001 support. If not specified at
140+
compilation time, it defaults to requesting POSIX.1-2008 support.
141141

142142
# Bug Reports
143143

@@ -152,14 +152,13 @@ Use `make safedist` to check the resulting tarball.
152152

153153
Copyright 2013-2025 MaxMind, Inc.
154154

155-
Licensed under the Apache License, Version 2.0 (the "License");
156-
you may not use this file except in compliance with the License.
157-
You may obtain a copy of the License at
155+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
156+
this file except in compliance with the License. You may obtain a copy of the
157+
License at
158158

159159
https://www.apache.org/licenses/LICENSE-2.0
160160

161-
Unless required by applicable law or agreed to in writing, software
162-
distributed under the License is distributed on an "AS IS" BASIS,
163-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164-
See the License for the specific language governing permissions and
165-
limitations under the License.
161+
Unless required by applicable law or agreed to in writing, software distributed
162+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
163+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
164+
specific language governing permissions and limitations under the License.

dev-bin/clang-format-all.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)