Skip to content

Commit aa7843c

Browse files
authored
chore: many org cleanups, new err on bad input (#86)
1 parent ca8df16 commit aa7843c

19 files changed

Lines changed: 163 additions & 108 deletions

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{yml,yaml}]
11+
indent_size = 2
12+
13+
[.gitmodules]
14+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
87
workflow_dispatch:
98

109
defaults:
@@ -14,8 +13,7 @@ defaults:
1413
jobs:
1514
test:
1615
name: Test ${{ matrix.os }} (${{ matrix.simd_mode }})
17-
permissions:
18-
contents: read
16+
permissions: { contents: read }
1917
runs-on: ${{ matrix.os }}
2018
strategy:
2119
fail-fast: false
@@ -52,8 +50,7 @@ jobs:
5250

5351
test-msrv:
5452
name: Test MSRV
55-
permissions:
56-
contents: read
53+
permissions: { contents: read }
5754
runs-on: ubuntu-latest
5855
steps:
5956
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -69,16 +66,14 @@ jobs:
6966
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
7067
with:
7168
toolchain: ${{ steps.msrv.outputs.value }}
72-
- run: just ci_mode=0 ci-test-msrv # Ignore warnings in MSRV
69+
- run: just ci-test-msrv
7370

7471
fuzz:
7572
name: Fuzz
76-
permissions:
77-
contents: read
73+
permissions: { contents: read }
7874
runs-on: ubuntu-latest
79-
env:
80-
# The number of seconds to run the fuzz target.
81-
FUZZ_TIME: 60
75+
# The number of seconds to run the fuzz target.
76+
env: { FUZZ_TIME: 60 }
8277
strategy:
8378
matrix:
8479
include:
@@ -109,8 +104,7 @@ jobs:
109104

110105
coverage:
111106
name: Code Coverage
112-
permissions:
113-
contents: read
107+
permissions: { contents: read }
114108
if: github.event_name != 'release'
115109
runs-on: ubuntu-latest
116110
steps:
@@ -119,13 +113,12 @@ jobs:
119113
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
120114
- uses: taiki-e/install-action@b8cecb83565409bcc297b2df6e77f030b2a468d5 # v2.82.0
121115
with: { tool: 'just,cargo-llvm-cov' }
122-
- name: Generate code coverage
123-
run: just ci-coverage
116+
- run: just ci-coverage
124117
- name: Upload coverage to Codecov
125118
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
126119
with:
127120
token: ${{ secrets.CODECOV_TOKEN }}
128-
files: target/llvm-cov/codecov.info
121+
files: target/llvm-cov/lcov.info
129122

130123
# This job checks if any of the previous jobs failed or were canceled.
131124
# This approach also allows some jobs to be skipped if they are not needed.
@@ -142,16 +135,17 @@ jobs:
142135

143136
release:
144137
# Some dependencies of the `ci-passed` job might be skipped, but we still want to run if the `ci-passed` job succeeded.
145-
if: always() && startsWith(github.ref, 'refs/tags/') && needs.ci-passed.result == 'success'
138+
if: |
139+
always()
140+
&& startsWith(github.ref, 'refs/tags/')
141+
&& needs.ci-passed.result == 'success'
146142
name: Publish to crates.io
147-
permissions:
148-
contents: read
143+
permissions: { contents: read }
149144
needs: [ ci-passed ]
150145
runs-on: ubuntu-latest
151146
steps:
152147
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
153148
with: { persist-credentials: false, submodules: recursive }
154-
- name: Publish to crates.io
155-
run: cargo publish
149+
- run: cargo publish
156150
env:
157151
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/dependabot.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ jobs:
1111
- name: Dependabot metadata
1212
id: metadata
1313
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
14-
with:
15-
github-token: "${{ secrets.GITHUB_TOKEN }}"
1614
- name: Approve Dependabot PRs
1715
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
1816
run: gh pr review --approve "$PR_URL"
1917
env:
20-
PR_URL: ${{github.event.pull_request.html_url}}
21-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18+
PR_URL: ${{ github.event.pull_request.html_url }}
2219
- name: Enable auto-merge for Dependabot PRs
2320
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
2421
run: gh pr merge --auto --squash "$PR_URL"
2522
env:
26-
PR_URL: ${{github.event.pull_request.html_url}}
27-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
23+
PR_URL: ${{ github.event.pull_request.html_url }}

.gitignore

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
**/*.bak
12
**/*.rs.bk
3+
*.iml
24
*.pdb
5+
*.proptest-regressions
6+
*.pyc
7+
.DS_Store
8+
.envrc
39
.idea/
10+
.pytest_cache/
11+
.venv/
412
.vscode/
5-
Cargo.lock
6-
codecov*
13+
__pycache__/
14+
codecov
15+
codecov.SHA256SUM*
716
debug/
17+
flamegraph*.svg
18+
perf.data*
19+
proptest-regressions/
20+
rustc-ice-*.txt
821
target/
922
temp/
1023
tmp/
1124
venv/
1225

13-
!codecov.yml
26+
# This is a library, so the lock file is not committed.
27+
Cargo.lock

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ repos:
3333
entry: sh -c "cargo fmt --all"
3434
language: rust
3535
pass_filenames: false
36+
37+
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
38+
rev: 3.6.1
39+
hooks:
40+
- id: editorconfig-checker

Cargo.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2024"
1111
license = "MIT OR Apache-2.0"
1212
keywords = ["fastpfor", "compression"]
1313
categories = ["compression"]
14-
rust-version = "1.86.0"
14+
rust-version = "1.86"
1515

1616
[package.metadata.docs.rs]
1717
all-features = true
@@ -51,9 +51,19 @@ unused_qualifications = "warn"
5151
missing_docs = "warn"
5252

5353
[lints.clippy]
54+
# Restrictions
55+
disallowed_methods = "forbid"
56+
panic_in_result_fn = "warn"
57+
todo = "warn"
58+
unimplemented = "warn"
59+
unwrap_used = "warn"
60+
use_self = "warn"
61+
62+
# Pedantics without being too noisy
5463
cargo = { level = "warn", priority = -1 }
5564
pedantic = { level = "warn", priority = -1 }
56-
use_self = "warn"
65+
66+
# Relax these for now
5767
cast_possible_truncation = "allow"
5868
cast_possible_wrap = "allow"
5969
cast_sign_loss = "allow"

LICENSE-APACHE

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

LICENSE-MIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

33
Copyright (c) 2024-2025 Francisco Jimenez <jjcfrank@gmail.com>
4-
Copyright (c) 2025 Yuri Astrakhan
4+
Copyright (c) 2025-2026 Yuri Astrakhan
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ Licensed under either of
209209

210210
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
211211
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
212-
213-
at your option.
212+
at your option.
214213

215214
### Contribution
216215

benches/fastpfor_benchmark.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Benchmark suite for `FastPFOR` compression codecs.
22
3+
#![allow(clippy::unwrap_used)]
4+
35
use std::hint::black_box;
46

57
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};

0 commit comments

Comments
 (0)