-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
f58baf7 chore: undo package rename (Jose Celano) 9833274 tests: add unit test for Value with serde_test (Jose Celano) f94c198 chore: add dev dependency serde_test (Jose Celano) 1eab404 test: add unit tests to Value (Jose Celano) b85b2a4 chore: add code coverage dir to gitignore (Jose Celano) 97168c5 chore: normalize todo mark to lowercase (Jose Celano) e2751eb chore(dev): add cargo alias (Jose Celano) fd7bdce test: add more tests for torrent files (Jose Celano) 9efb5e8 tests: enable tests with potencial unintended behavior (Jose Celano) a7fd343 test: add more failing tests (Jose Celano) a7587d4 docs: fix coverage workflow badge in README (Jose Celano) 252849f ci: add coverage workflow (Jose Celano) 5bc8202 ci: ignore failing tests (Jose Celano) 36e31ae docs: fix workflow badge link in README (Jose Celano) 885ebe9 chrore: update cSpell dictionary (Jose Celano) 5e9dd5c test: enable test (Jose Celano) 1ea262d ci: add benchmarking workflow (Jose Celano) b3b2a44 fix: [#9] Clipply errors (Jose Celano) cdd4200 fix: cargo build errors (Jose Celano) caf8cf5 doc: add new workflow badgets to README (Jose Celano) b3759c1 chore: bump actions/checkout from 3 to 4 (Jose Celano) 5b35fd7 ci: add cargo config (Jose Celano) a833a34 ci: add formatting and checking workflows (Jose Celano) e88aeec doc: add testing workflow badget to README (Jose Celano) 47549ef ci: add dependabot config (Jose Celano) 6ce2e9d test: add a failing test for nested list deserialization (Jose Celano) decdff6 Avoid eagerly allocating too much memory (5225225) a1597cc Add cargo-fuzz fuzzer (5225225) 43ba81e Introduce failing test for flattened enums (Nicholas Rempel) 625081a new torrust-serde-bencode package (Jose Celano) 403f043 Add test for ser/de of struct with vec of tuples (issue #17) (Adam Cigánek) 4faf05f Minor change to support rust version >= 1.40.0 (Adam Cigánek) 0c6c144 Fix deserialization of nested tuple (Adam Cigánek) 06bb9a6 Fix deserialization of flattened adjacently tagged enum (Adam Cigánek) 79b7540 Fix deserialization of adjacently tagged enums (Adam Cigánek) 1eecff4 Fix warnings and clippy lints (Adam Cigánek) e6f9b53 Apply rustfmt (Adam Cigánek) Pull request description: I have been working on a fork because this project was inactive, but I contacted @toby, who made me a maintainer and gave it access to publish new versions. I was trying to fix a bug I found [here](torrust/torrust-index#266). . After debugging, I realized the bug was already fixed in this repo but has yet to be included in a new release. I've been working on the fork and I would like to merge those changes back and publish the version `v0.2.4` on [crates.io](https://crates.io/crates/serde_bencode). The changes I've made so far are: - Fix cargo build and clippy warnings. - Merge PRs that were ready to merge. - Update dependencies. - Add GitHub workflows for checking, formatting, testing, benchmarking and coverage. - Add tests for torrent files, which I suppose is the most common use for this package. - Add unit tests for `Value` struct. ACKs for top commit: josecelano: ACK e894328 Tree-SHA512: 331e82dba9e0a8f4f2c9be30a09537707c39e05223d601bbfb7f6792a7e7e95b9bf60a65b097ed6ee2aea0e2c22196a8d6ded8c82cd9a59db274774002e50370
- Loading branch information
Showing
27 changed files
with
1,969 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[alias] | ||
cov = "llvm-cov" | ||
cov-lcov = "llvm-cov --lcov --output-path=./.coverage/lcov.info" | ||
cov-html = "llvm-cov --html" | ||
time = "build --timings --all-targets" | ||
|
||
[build] | ||
rustflags = [ | ||
"-D", | ||
"warnings", | ||
"-D", | ||
"future-incompatible", | ||
"-D", | ||
"let-underscore", | ||
"-D", | ||
"nonstandard-style", | ||
"-D", | ||
"rust-2018-compatibility", | ||
"-D", | ||
"rust-2018-idioms", | ||
"-D", | ||
"rust-2021-compatibility", | ||
"-D", | ||
"unused", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
target-branch: "main" | ||
|
||
- package-ecosystem: cargo | ||
directory: / | ||
schedule: | ||
interval: daily | ||
target-branch: "main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Benchmarking | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
name: Benchmarking | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
toolchain: [nightly] | ||
|
||
steps: | ||
- id: checkout | ||
name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- id: setup | ||
name: Setup Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
|
||
- id: cache | ||
name: Enable Workflow Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- id: Benchmarking | ||
name: Run Benchmarking | ||
run: cargo bench |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Checking | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
name: Checking | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
toolchain: [stable, nightly] | ||
|
||
steps: | ||
- id: checkout | ||
name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- id: setup | ||
name: Setup Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
|
||
- id: cache | ||
name: Enable Workflow Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- id: check | ||
name: Run Build Checks | ||
run: cargo check --tests --examples --workspace --all-features | ||
|
||
- id: lint | ||
name: Run Lint Checks | ||
run: cargo clippy --tests --examples --workspace --all-features -- -D clippy::correctness -D clippy::suspicious -D clippy::complexity -D clippy::perf -D clippy::style -D clippy::pedantic | ||
|
||
- id: doc | ||
name: Run Documentation Checks | ||
run: cargo test --doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
report: | ||
name: Report | ||
environment: coverage | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests" | ||
RUSTDOCFLAGS: "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests" | ||
|
||
steps: | ||
- id: checkout_push | ||
if: github.event_name == 'push' | ||
name: Checkout Repository (Push) | ||
uses: actions/checkout@v4 | ||
|
||
- id: checkout_pull_request_target | ||
if: github.event_name == 'pull_request_target' | ||
name: Checkout Repository (Pull Request Target) | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "refs/pull/${{ github.event.pull_request.number }}/head" | ||
|
||
- id: setup | ||
name: Setup Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
components: llvm-tools-preview | ||
|
||
- id: cache | ||
name: Enable Workflow Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- id: tools | ||
name: Install tools | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: grcov,cargo-llvm-cov,nextest | ||
|
||
- id: print | ||
name: Print Coverage Report | ||
run: cargo llvm-cov nextest | ||
|
||
- id: report | ||
name: Generate Coverage Report | ||
uses: alekitto/grcov@v0.2 | ||
|
||
- id: upload | ||
name: Upload Coverage Report | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ${{ steps.coverage.outputs.report }} | ||
verbose: true | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Formatting | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
format: | ||
name: Formatting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- id: checkout | ||
name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- id: setup | ||
name: Setup Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- id: cache | ||
name: Enable Workflow Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- id: format | ||
name: Run Formatting-Checks | ||
run: cargo fmt --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
name: Testing | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
toolchain: [stable, nightly] | ||
|
||
steps: | ||
- id: checkout | ||
name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- id: setup | ||
name: Setup Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: llvm-tools-preview | ||
|
||
- id: cache | ||
name: Enable Job Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- id: test | ||
name: Run Unit Tests | ||
run: cargo test --tests --examples --workspace --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
target | ||
Cargo.lock | ||
.coverage | ||
*.rustfmt | ||
Cargo.lock | ||
target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"streetsidesoftware.code-spell-checker", | ||
"rust-lang.rust-analyzer" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"[rust]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"rust-analyzer.checkOnSave": true, | ||
"rust-analyzer.check.command": "clippy", | ||
"rust-analyzer.check.allTargets": true, | ||
"rust-analyzer.check.extraArgs": [ | ||
"--", | ||
"-D", | ||
"clippy::correctness", | ||
"-D", | ||
"clippy::suspicious", | ||
"-W", | ||
"clippy::complexity", | ||
"-W", | ||
"clippy::perf", | ||
"-W", | ||
"clippy::style", | ||
"-W", | ||
"clippy::pedantic", | ||
], | ||
"rust-analyzer.linkedProjects": [ | ||
"./Cargo.toml" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.