Skip to content

Commit be136b2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into sync-from-rust
2 parents 82f775d + 01dd31f commit be136b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1858
-524
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ your PR is merged.
1212
If you added a new lint, here's a checklist for things that will be
1313
checked during review or continuous integration.
1414

15-
- [ ] Followed [lint naming conventions][lint_naming]
16-
- [ ] Added passing UI tests (including committed `.stderr` file)
17-
- [ ] `cargo test` passes locally
18-
- [ ] Executed `cargo dev update_lints`
19-
- [ ] Added lint documentation
20-
- [ ] Run `cargo dev fmt`
15+
- \[ ] Followed [lint naming conventions][lint_naming]
16+
- \[ ] Added passing UI tests (including committed `.stderr` file)
17+
- \[ ] `cargo test` passes locally
18+
- \[ ] Executed `cargo dev update_lints`
19+
- \[ ] Added lint documentation
20+
- \[ ] Run `cargo dev fmt`
2121

2222
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
2323

.github/workflows/clippy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
github_token: "${{ secrets.github_token }}"
3737

3838
- name: rust-toolchain
39-
uses: actions-rs/[email protected].3
39+
uses: actions-rs/[email protected].6
4040
with:
4141
toolchain: nightly
4242
target: x86_64-unknown-linux-gnu
4343
profile: minimal
4444

4545
- name: Checkout
46-
uses: actions/checkout@v2.0.0
46+
uses: actions/checkout@v2.3.3
4747

4848
- name: Run cargo update
4949
run: cargo update
@@ -63,7 +63,7 @@ jobs:
6363
- name: Set LD_LIBRARY_PATH (Linux)
6464
run: |
6565
SYSROOT=$(rustc --print sysroot)
66-
echo "::set-env name=LD_LIBRARY_PATH::${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}"
66+
echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
6767
6868
- name: Build
6969
run: cargo build --features deny-warnings

.github/workflows/clippy_bors.yml

+15-20
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ env:
1111
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
1212
NO_FMT_TEST: 1
1313

14+
defaults:
15+
run:
16+
shell: bash
17+
1418
jobs:
1519
changelog:
1620
runs-on: ubuntu-latest
@@ -20,7 +24,7 @@ jobs:
2024
with:
2125
github_token: "${{ secrets.github_token }}"
2226
- name: Checkout
23-
uses: actions/checkout@v2.0.0
27+
uses: actions/checkout@v2.3.3
2428
with:
2529
ref: ${{ github.ref }}
2630

@@ -81,14 +85,14 @@ jobs:
8185
if: matrix.host == 'i686-unknown-linux-gnu'
8286

8387
- name: rust-toolchain
84-
uses: actions-rs/[email protected].3
88+
uses: actions-rs/[email protected].6
8589
with:
8690
toolchain: nightly
8791
target: ${{ matrix.host }}
8892
profile: minimal
8993

9094
- name: Checkout
91-
uses: actions/checkout@v2.0.0
95+
uses: actions/checkout@v2.3.3
9296

9397
- name: Run cargo update
9498
run: cargo update
@@ -105,14 +109,13 @@ jobs:
105109
run: bash setup-toolchain.sh
106110
env:
107111
HOST_TOOLCHAIN: ${{ matrix.host }}
108-
shell: bash
109112

110113
# Run
111114
- name: Set LD_LIBRARY_PATH (Linux)
112115
if: runner.os == 'Linux'
113116
run: |
114117
SYSROOT=$(rustc --print sysroot)
115-
echo "::set-env name=LD_LIBRARY_PATH::${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}"
118+
echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
116119
- name: Link rustc dylib (MacOS)
117120
if: runner.os == 'macOS'
118121
run: |
@@ -122,41 +125,33 @@ jobs:
122125
- name: Set PATH (Windows)
123126
if: runner.os == 'Windows'
124127
run: |
125-
$sysroot = rustc --print sysroot
126-
$env:PATH += ';' + $sysroot + '\bin'
127-
echo "::set-env name=PATH::$env:PATH"
128+
SYSROOT=$(rustc --print sysroot)
129+
echo "$SYSROOT/bin" >> $GITHUB_PATH
128130
129131
- name: Build
130132
run: cargo build --features deny-warnings
131-
shell: bash
132133

133134
- name: Test
134135
run: cargo test --features deny-warnings
135-
shell: bash
136136

137137
- name: Test clippy_lints
138138
run: cargo test --features deny-warnings
139-
shell: bash
140139
working-directory: clippy_lints
141140

142141
- name: Test rustc_tools_util
143142
run: cargo test --features deny-warnings
144-
shell: bash
145143
working-directory: rustc_tools_util
146144

147145
- name: Test clippy_dev
148146
run: cargo test --features deny-warnings
149-
shell: bash
150147
working-directory: clippy_dev
151148

152149
- name: Test cargo-clippy
153150
run: ../target/debug/cargo-clippy
154-
shell: bash
155151
working-directory: clippy_workspace_tests
156152

157153
- name: Test clippy-driver
158154
run: bash .github/driver.sh
159-
shell: bash
160155
env:
161156
OS: ${{ runner.os }}
162157

@@ -165,7 +160,7 @@ jobs:
165160
run: |
166161
cargo +nightly install cargo-cache --no-default-features --features ci-autoclean cargo-cache
167162
cargo cache
168-
shell: bash
163+
169164
integration_build:
170165
needs: changelog
171166
runs-on: ubuntu-latest
@@ -177,14 +172,14 @@ jobs:
177172
github_token: "${{ secrets.github_token }}"
178173

179174
- name: rust-toolchain
180-
uses: actions-rs/[email protected].3
175+
uses: actions-rs/[email protected].6
181176
with:
182177
toolchain: nightly
183178
target: x86_64-unknown-linux-gnu
184179
profile: minimal
185180

186181
- name: Checkout
187-
uses: actions/checkout@v2.0.0
182+
uses: actions/checkout@v2.3.3
188183

189184
- name: Run cargo update
190185
run: cargo update
@@ -258,14 +253,14 @@ jobs:
258253
github_token: "${{ secrets.github_token }}"
259254

260255
- name: rust-toolchain
261-
uses: actions-rs/[email protected].3
256+
uses: actions-rs/[email protected].6
262257
with:
263258
toolchain: nightly
264259
target: x86_64-unknown-linux-gnu
265260
profile: minimal
266261

267262
- name: Checkout
268-
uses: actions/checkout@v2.0.0
263+
uses: actions/checkout@v2.3.3
269264

270265
- name: Run cargo update
271266
run: cargo update

.github/workflows/clippy_dev.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ jobs:
2323
steps:
2424
# Setup
2525
- name: rust-toolchain
26-
uses: actions-rs/[email protected].3
26+
uses: actions-rs/[email protected].6
2727
with:
2828
toolchain: nightly
2929
target: x86_64-unknown-linux-gnu
3030
profile: minimal
3131
components: rustfmt
3232

3333
- name: Checkout
34-
uses: actions/checkout@v2.0.0
34+
uses: actions/checkout@v2.3.3
3535

3636
# Run
3737
- name: Build

.github/workflows/deploy.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
steps:
2222
# Setup
2323
- name: Checkout
24-
uses: actions/checkout@v2.0.0
24+
uses: actions/checkout@v2.3.3
2525

2626
- name: Checkout
27-
uses: actions/checkout@v2.0.0
27+
uses: actions/checkout@v2.3.3
2828
with:
2929
ref: ${{ env.TARGET_BRANCH }}
3030
path: 'out'
@@ -34,10 +34,10 @@ jobs:
3434
if: startswith(github.ref, 'refs/tags/')
3535
run: |
3636
TAG=$(basename ${{ github.ref }})
37-
echo "::set-env name=TAG_NAME::$TAG"
37+
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
3838
- name: Set beta to true
3939
if: github.ref == 'refs/heads/beta'
40-
run: echo "::set-env name=BETA::true"
40+
run: echo "BETA=true" >> $GITHUB_ENV
4141

4242
- name: Use scripts and templates from master branch
4343
run: |

.github/workflows/remark.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
steps:
1717
# Setup
1818
- name: Checkout
19-
uses: actions/checkout@v2.0.0
19+
uses: actions/checkout@v2.3.3
2020

2121
- name: Setup Node.js
22-
uses: actions/setup-node@v1.1.0
22+
uses: actions/setup-node@v1.4.4
2323

2424
- name: Install remark
2525
run: npm install remark-cli remark-lint remark-lint-maximum-line-length remark-preset-lint-recommended

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,7 @@ Released 2018-09-13
17961796
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
17971797
[`manual_strip`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
17981798
[`manual_swap`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap
1799+
[`manual_unwrap_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or
17991800
[`many_single_char_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
18001801
[`map_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
18011802
[`map_entry`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
@@ -1892,6 +1893,7 @@ Released 2018-09-13
18921893
[`print_with_newline`]: https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline
18931894
[`println_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string
18941895
[`ptr_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
1896+
[`ptr_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
18951897
[`ptr_offset_with_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
18961898
[`pub_enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#pub_enum_variant_names
18971899
[`question_mark`]: https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
@@ -1917,6 +1919,7 @@ Released 2018-09-13
19171919
[`rest_pat_in_fully_bound_structs`]: https://rust-lang.github.io/rust-clippy/master/index.html#rest_pat_in_fully_bound_structs
19181920
[`result_map_or_into_option`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_or_into_option
19191921
[`result_map_unit_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_unit_fn
1922+
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
19201923
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
19211924
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
19221925
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push

Cargo.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ path = "src/driver.rs"
3131
# begin automatic update
3232
clippy_lints = { version = "0.0.212", path = "clippy_lints" }
3333
# end automatic update
34-
semver = "0.10"
34+
semver = "0.11"
3535
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"}
3636
tempfile = { version = "3.1.0", optional = true }
37-
lazy_static = "1.0"
3837

3938
[dev-dependencies]
40-
cargo_metadata = "0.11.1"
39+
cargo_metadata = "0.12"
4140
compiletest_rs = { version = "0.5.0", features = ["tmp"] }
4241
tester = "0.7"
43-
lazy_static = "1.0"
4442
clippy-mini-macro-test = { version = "0.2", path = "mini-macro" }
4543
serde = { version = "1.0", features = ["derive"] }
4644
derive-new = "0.5"

README.md

+26-5
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,33 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
169169

170170
Note: `deny` produces errors instead of warnings.
171171

172-
If you do not want to include your lint levels in your code, you can globally enable/disable lints by passing extra
173-
flags to Clippy during the run: `cargo clippy -- -A clippy::lint_name` will run Clippy with `lint_name` disabled and
174-
`cargo clippy -- -W clippy::lint_name` will run it with that enabled. This also works with lint groups. For example you
175-
can run Clippy with warnings for all lints enabled: `cargo clippy -- -W clippy::pedantic`
172+
If you do not want to include your lint levels in your code, you can globally enable/disable lints
173+
by passing extra flags to Clippy during the run:
174+
175+
To disable `lint_name`, run
176+
177+
```terminal
178+
cargo clippy -- -A clippy::lint_name
179+
```
180+
181+
And to enable `lint_name`, run
182+
183+
```terminal
184+
cargo clippy -- -W clippy::lint_name
185+
```
186+
187+
This also works with lint groups. For example you
188+
can run Clippy with warnings for all lints enabled:
189+
```terminal
190+
cargo clippy -- -W clippy::pedantic
191+
```
192+
176193
If you care only about a single lint, you can allow all others and then explicitly reenable
177-
the lint(s) you are interested in: `cargo clippy -- -Aclippy::all -Wclippy::useless_format -Wclippy::...`
194+
the lint(s) you are interested in:
195+
```terminal
196+
cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
197+
```
198+
Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`.
178199

179200
## Contributing
180201

clippy_dev/src/update_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn run(update_mode: UpdateMode) {
2929
false,
3030
update_mode == UpdateMode::Change,
3131
|| {
32-
format!("pub static ref ALL_LINTS: Vec<Lint> = vec!{:#?};", sorted_usable_lints)
32+
format!("vec!{:#?}", sorted_usable_lints)
3333
.lines()
3434
.map(ToString::to_string)
3535
.collect::<Vec<_>>()

clippy_lints/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ keywords = ["clippy", "lint", "plugin"]
1717
edition = "2018"
1818

1919
[dependencies]
20-
cargo_metadata = "0.11.1"
20+
cargo_metadata = "0.12"
2121
if_chain = "1.0.0"
2222
itertools = "0.9"
2323
pulldown-cmark = { version = "0.8", default-features = false }
@@ -27,7 +27,7 @@ serde = { version = "1.0", features = ["derive"] }
2727
smallvec = { version = "1", features = ["union"] }
2828
toml = "0.5.3"
2929
unicode-normalization = "0.1"
30-
semver = "0.10.0"
30+
semver = "0.11"
3131
# NOTE: cargo requires serde feat in its url dep
3232
# see <https://github.com/rust-lang/rust/pull/63587#issuecomment-522343864>
3333
url = { version = "2.1.0", features = ["serde"] }

0 commit comments

Comments
 (0)