Commit Graph

62 Commits

Author SHA1 Message Date
Lzu Tao
049800d304 nit: ! is not on a condition and skips errexit 2019-10-22 16:16:01 +07:00
Lzu Tao
f3ace5e71d build: use shared target dir 2019-10-22 16:16:01 +07:00
Lzu Tao
b869eeb2a4 build: improve script and travis config
* fix a diff failure on windows

See https://travis-ci.com/rust-lang/rust-clippy/jobs/245971932#L1625
for an example.

* use cmp instead of diff > /dev/null

* clone single branch instead of clone then checking out

* do not decrypt key if have no diff change
2019-10-22 10:14:39 +07:00
bors
a73bb33399 Auto merge of #4273 - mikerite:deny-warnings, r=flip1995
Deny warnings in CI

changelog: none
2019-07-15 07:51:29 +00:00
Michael Wright
b523d35d41 Deny warnings in CI 2019-07-15 07:35:02 +02:00
flip1995
4817c2c381
Test with different sysroots dependent on the OS 2019-07-13 12:48:43 +02:00
flip1995
6b8ebcc0c8
Don't re-set the LD_LIBRARY_PATH in base_tests.sh 2019-07-13 12:48:42 +02:00
Michael Wright
0c00391ed0
Remove format checks from CI scripts again. 2019-07-07 15:11:38 +02:00
Michael Wright
503474a647
Remove format checks from CI script 2019-07-07 15:11:37 +02:00
Philipp Hansch
d9a8a8a778
Add a stderr file length check to clippy_dev
This adds a check to `clippy_dev` that enforces a maximum line count for
`stderr` files. CI will fail if the line count is exceeded. It's
currently set to `320` lines.

Ideally this would be implemented in `compiletest-rs` but there are
plans to move Rust's `compiletest` into the `compiletest-rs` repository
and I don't want to do the work in `compiletest` twice. However, I also
don't want to wait until the move is done, so I added the check to
`clippy_dev` until it makes sense to add it to compiletest-rs.

cc #2038
2019-05-16 21:18:32 +02:00
Philipp Hansch
0eb7596fdc
Exclude ice-3891.rs from rustfmt run
Because the code triggers a rustc parse error which makes rustfmt fail.
2019-04-09 20:53:38 +02:00
bors
920112d723 Auto merge of #3824 - phansch:adding_lints, r=phansch
Add lint writing documentation

[Rendered](https://github.com/phansch/rust-clippy/blob/adding_lints/doc/adding_lints.md)

This adds a new documentation page that explains how to write Clippy
lints. It guides the reader through creating a `foo` function lint.

I plan to iterate a bit more on the prose of some sections, but I think the
general structure is fine now, so I'm looking forward to feedback =)

One thing I'm not sure about: I felt like this is too big for CONTRIBUTING.md
so I put it into a new `doc/` directory. I can imagine having more
documentation in the future, so we might even want to create a book using
mdbook instead? Or should everything go into CONTRIBUTING.md?

Further things left to do:

- [x] Link from CONTRIBUTING.md
- [x] Remove things covered in this guide from CONTRIBUTING.md
- [x] Section about `clippy::author` attribute
- [x] Run `remark-lint` on CI over the `doc` directory and fix things
2019-03-09 15:05:38 +00:00
Michael Wright
fbcf7eefb9 Add [rustfmt::skip] to unused_unit test 2019-03-07 08:13:59 +02:00
Michael Wright
131c8f6bf2 Add [rustfmt::skip] to doc_markdown tests 2019-03-07 08:03:15 +02:00
Philipp Hansch
680dc8a105
Run remark in doc directory, too. 2019-03-03 15:03:25 +01:00
Michael Wright
6e6e39b4a8 Add rustfmt::skip to double_parens tests 2019-02-28 08:02:45 +02:00
Michael Wright
11682b4cd2 Add rustfmt::skip to outer attr format tests 2019-02-27 07:41:07 +02:00
Michael Wright
7fd0fbf435 Add [rustfmt::skip] to formatting lint tests 2019-02-26 07:49:46 +02:00
Michael Wright
0182a6640e Fix useless_format suggestions 2019-02-24 07:30:08 +02:00
Michael Wright
7a43509cc4 rustfmt tests/ui/methods.rs 2019-02-22 08:05:21 +02:00
bors
e176324fc5 Auto merge of #3665 - jsgf:master, r=oli-obk
Start making clippy easier to invoke in non-cargo contexts

Clippy (clippy-driver) currently has a couple of strong but unnecessary couplings with cargo. This series:
1. makes detection of check builds more robust, and
2. make clippy-driver use the --sysroot specified on the command line as its internal sysroot.
2019-02-06 15:43:07 +00:00
Jeremy Fitzhardinge
47563a13eb Add setup-toolchain.sh script to configure the master version of rustc,
and update CONTRIBUTING.md accordingly.
2019-02-03 14:41:46 -08:00
Jeremy Fitzhardinge
f0131fbab6 Add a CI test for cargoless use of clippy-driver 2019-02-02 19:35:06 -08:00
Jeremy Fitzhardinge
b07f1b0974 base-tests: use subshells to manage current directory
It saves on having to pair `cd <path> && think && cd ..`.
2019-02-02 11:43:21 -08:00
Philipp Hansch
38d4ac7cea
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2019-01-08 21:46:39 +01:00
Matthias Krüger
38fabcbdf2 tests: fix formatting and update test output
fix script one last time™
2018-12-27 17:03:53 +01:00
Matthias Krüger
84ee884cc4 base tests: make sure to fail CI if tests need formatting 2018-12-27 16:56:08 +01:00
Matthias Krüger
bcc309f27d base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
this errored because rustfmt is not available on the master toolchain
2018-12-27 16:56:07 +01:00
Matthias Krüger
9fb8022026 base tests: make sure cargo-clippy binary can be called directly 2018-12-14 21:43:40 +01:00
bors
f5d6aca197 Auto merge of #3537 - matthiaskrgr:fix_script_2, r=matthiaskrgr
base-tests: don't print all commands to stdout during the loop

Fixes thinko in #3529
2018-12-12 09:56:38 +00:00
Matthias Krüger
591738c35a base-tests: don't print all commands to stdout during the loop 2018-12-12 10:27:13 +01:00
Matthias Krüger
7fe39c9c6e fix typo in script 2018-12-12 09:17:43 +01:00
Matthias Krüger
743e9e3561 Merge branch 'master' into rustfmt_tests 2018-12-11 01:42:38 +01:00
Matthias Krüger
0a6e568f07 test formatting: don't format tests/ui/formatting.rs 2018-12-10 15:46:01 +01:00
Matthias Krüger
7bcc2cd9c8 update test stderr 2018-12-10 08:22:07 +01:00
Matthias Krüger
31d3bd92be travis: base-tests: share CARGO_TARGET_DIR between check runs of subcrates to avoid unneccessarily recompiling deps. 2018-12-09 22:47:22 +01:00
Matthias Krüger
1218145bc9 base tests: assert that tests are properly formatted. 2018-12-09 22:43:45 +01:00
Wayne Warren
72247d8e2e Fix dogfood tests. 2018-12-05 18:18:17 -06:00
Philipp Hansch
d8166bf141
Travis: Add rustc sysroot bin to PATH for windows build 2018-12-02 14:33:19 +01:00
flip1995
4e0938d349
Let travis run cargo fmt --all -- --check 2018-11-27 21:11:05 +01:00
Philipp Hansch
90f31e21ab
RIIR update lints: Add check mode (update_lints.py rewrite complete)
This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this

* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error

`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.

🏁
2018-11-05 07:18:47 +01:00
bors[bot]
a07c271559 Merge #3399
3399: RIIR update lints: Generate modules section and lint group sections r=flip1995 a=phansch

This adds the last missing parts of the generating code.

cc #2882

Co-authored-by: Philipp Hansch <dev@phansch.net>
2018-11-03 19:11:35 +00:00
Philipp Hansch
6e3320c7ef
Test clippy_dev on CI and fix test 2018-11-03 10:58:45 +01:00
Matthias Krüger
df7cff31dc clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172
2018-11-02 12:16:43 +01:00
Matthias Krüger
a90084d587 slightly simplify integration tests 2018-10-27 10:54:46 +02:00
Matthias Krüger
d6ca12a70d simplify ci base-tests 2018-10-26 20:00:43 +02:00
Philipp Hansch
f5a38f2323
Only run markdown linter on linux
Because:

* There's no need to run it on more than one platform
* It doesn't work on windows
2018-10-12 08:39:55 +02:00
Manish Goregaokar
23e5e24f52 Add license header to other files 2018-10-06 09:43:08 -07:00
Michael Wright
c52b33decb Make travis check lint list 2018-09-19 07:05:36 +02:00
flip1995
146b25e39b
Also run internal lints on the code base 2018-09-12 01:33:28 +02:00