History

Merge branch 'cargo-config-toml'

Sebastian Thiel committed 3 years ago

Commit 12f4cec2 parents 036e60a 396edb93 files · +33 −23Browse files

Unified · Split

3 files
  1. .cargo/config.toml +23 −0
  2. .github/workflows/ci.yml +1 −1
  3. justfile +9 −22
.cargo/config.toml+23−0
@@ -0,0 +1,23 @@
1+[target.'cfg(any(test, not(test)))']
2+rustflags = [
3+ # Rustc lints
4+ # "-W", "warning_name"
5+ # "-A", "warning_name"
6+
7+ # Clippy lints
8+ "-W", "clippy::cloned_instead_of_copied",
9+ "-W", "clippy::explicit_iter_loop",
10+ "-W", "clippy::map_unwrap_or",
11+ "-W", "clippy::redundant_closure_for_method_calls",
12+ "-W", "clippy::unnested_or_patterns",
13+ "-W", "clippy::uninlined_format_args",
14+
15+ # Rejected for now, and why
16+ # "-W" "clippy::default_trait_access" - sometimes makes imports necessary, just for a default value. It's good for more explicit typing though.
17+ # "-W" "clippy::range_plus_one" - useful, but caused too many false positives as we use range types directly quite a lot
18+
19+
20+ # Rustdoc lints
21+ # "-W", "rustdoc::warning_name"
22+ # "-A", "rustdoc::warning_name"
23+]
.github/workflows/ci.yml+1−1
@@ -144,7 +144,7 @@ jobs: · 143 unmodified lines
144144 components: clippy,rustfmt
145145 - uses: extractions/setup-just@v1
146146 - name: Run cargo clippy
147− run: just clippy
147+ run: just clippy -D warnings
148148 - name: Run cargo doc
149149 run: just doc
150150 - name: Run cargo fmt
justfile+9−22
@@ -14,32 +14,19 @@ test: clippy check doc unit-tests journey-tests-pure journey-tests-small journey · 13 unmodified lines
1414 # run all tests, without clippy, including journey tests, try building docs
1515 ci-test: check doc unit-tests journey-tests-pure journey-tests-small journey-tests-async journey-tests journey-tests-smart-release
1616
17−# Rejected for now, and why
18−# -D clippy::default-trait-access - sometimes makes imports necessary, just for a default value. It's good for more explicit typing though.
19−# -D clippy::range-plus-one - useful, but caused too many false positives as we use range types directly quite a lot
20−
21−clippy-flags := """
22− -D clippy::cloned-instead-of-copied \
23− -D clippy::explicit-iter-loop \
24− -D clippy::map-unwrap-or \
25− -D clippy::redundant-closure-for-method-calls \
26− -D clippy::uninlined_format_args \
27− -D clippy::unnested-or-patterns \
28−"""
29−
3017 # Run cargo clippy on all crates
31−clippy:
32− cargo clippy --all --tests --examples -- {{ clippy-flags }}
33− cargo clippy --all --no-default-features --features small -- {{ clippy-flags }}
34− cargo clippy --all --no-default-features --features max-pure -- {{ clippy-flags }}
35− cargo clippy --all --no-default-features --features lean-async --tests -- {{ clippy-flags }}
18+clippy *clippy-args:
19+ cargo clippy --all --tests --examples -- {{ clippy-args }}
20+ cargo clippy --all --no-default-features --features small -- {{ clippy-args }}
21+ cargo clippy --all --no-default-features --features max-pure -- {{ clippy-args }}
22+ cargo clippy --all --no-default-features --features lean-async --tests -- {{ clippy-args }}
3623
3724 # Run cargo clippy on all crates, fixing what can be fixed, and format all code
3825 clippy-fix:
39− cargo clippy --fix --all --tests --examples -- {{ clippy-flags }}
40− cargo clippy --fix --allow-dirty --all --no-default-features --features small -- {{ clippy-flags }}
41− cargo clippy --fix --allow-dirty --all --no-default-features --features max-pure -- {{ clippy-flags }}
42− cargo clippy --fix --allow-dirty --all --no-default-features --features lean-async --tests -- {{ clippy-flags }}
26+ cargo clippy --fix --all --tests --examples
27+ cargo clippy --fix --allow-dirty --all --no-default-features --features small
28+ cargo clippy --fix --allow-dirty --all --no-default-features --features max-pure
29+ cargo clippy --fix --allow-dirty --all --no-default-features --features lean-async --tests
4330 cargo fmt --all
4431
4532 # Build all code in suitable configurations

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t