Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy
on:
push:
branches:
- master
- main
- beta
tags:
- rust-1.**
Expand Down Expand Up @@ -54,10 +54,10 @@ jobs:
# We need to check out all files that (transitively) depend on the
# structure of the gh-pages branch, so that we're able to change that
# structure without breaking the deployment.
- name: Use deploy files from master branch
- name: Use deploy files from main branch
run: |
git fetch --no-tags --prune --depth=1 origin master
git checkout origin/master -- .github/deploy.sh util/versions.py util/gh-pages/versions.html
git fetch --no-tags --prune --depth=1 origin main
git checkout origin/main -- .github/deploy.sh util/versions.py util/gh-pages/versions.html

# Generate lockfile for caching to avoid build problems with cached deps
- name: cargo generate-lockfile
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: cargo collect-metadata
run: cargo collect-metadata
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lintcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
# Unsetting this would make so that any malicious package could get our Github Token
persist-credentials: false

# HEAD is the generated merge commit `refs/pull/N/merge` between the PR and `master`, `HEAD^`
# being the commit from `master` that is the base of the merge
# HEAD is the generated merge commit `refs/pull/N/merge` between the PR and `main`, `HEAD^`
# being the commit from `main` that is the base of the merge
- name: Checkout base
run: git checkout HEAD^

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
rustup toolchain install nightly --component rust-docs
rustup override set nightly
curl https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh -o linkcheck.sh
curl https://raw.githubusercontent.com/rust-lang/rust/main/src/tools/linkchecker/linkcheck.sh -o linkcheck.sh
sh linkcheck.sh clippy --path ./book

- name: Build mdbook
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6730,9 +6730,9 @@ Released 2018-09-13
[`AsRef`]: https://doc.rust-lang.org/std/convert/trait.AsRef.html
[configuration file]: ./rust-clippy#configuration
[pull3665]: https://github.com/rust-lang/rust-clippy/pull/3665
[adding_lints]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/adding_lints.md
[`README.md`]: https://github.com/rust-lang/rust-clippy/blob/master/README.md
[Clippy's lint list]: https://rust-lang.github.io/rust-clippy/master/index.html
[adding_lints]: https://github.com/rust-lang/rust-clippy/blob/main/book/src/development/adding_lints.md
[`README.md`]: https://github.com/rust-lang/rust-clippy/blob/main/README.md
[Clippy's lint list]: https://rust-lang.github.io/rust-clippy/main/index.html

<!-- lint disable no-unused-definitions -->
<!-- begin autogenerated links to lint list -->
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ a [developer guide] and is a good place to start your journey.
All issues on Clippy are mentored, if you want help simply ask someone from the
Clippy team directly by mentioning them in the issue or over on [Zulip]. All
currently active team members can be found
[here](https://github.com/rust-lang/rust-clippy/blob/master/triagebot.toml#L18)
[here](https://github.com/rust-lang/rust-clippy/blob/main/triagebot.toml#L18)

Some issues are easier than others. The [`good first issue`] label can be used to find the easy
issues. You can use `@rustbot claim` to assign the issue to yourself.
Expand Down Expand Up @@ -176,7 +176,7 @@ via the `LateContext` parameter.
That's why the `else_if_without_else` example is listed in `early_lint_methods!`. Because the
[actual lint logic][else_if_without_else] does not depend on any type information.

[lint_crate_entry]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/lib.rs
[lint_crate_entry]: https://github.com/rust-lang/rust-clippy/blob/main/clippy_lints/src/lib.rs
[else_if_without_else]: https://github.com/rust-lang/rust-clippy/blob/4253aa7137cb7378acc96133c787e49a345c2b3c/clippy_lints/src/else_if_without_else.rs
[`LintStore`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html
[early_lint_pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.

[There are over 800 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
[There are over 800 lints included in this crate!](https://rust-lang.github.io/rust-clippy/main/index.html)

Lints are divided into categories, each with a default [lint level](https://doc.rust-lang.org/rustc/lints/levels.html).
You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the lint level by category.
Expand Down Expand Up @@ -35,9 +35,9 @@ on a case-by-case basis before enabling.
- Preventing panicking in certain functions (e.g. [`clippy::unwrap_used`]).
- Running a lint only on a subset of code (e.g. `#[forbid(clippy::float_arithmetic)]` on a module).

[`clippy::else_if_without_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
[`clippy::todo`]: https://rust-lang.github.io/rust-clippy/master/index.html#todo
[`clippy::unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
[`clippy::else_if_without_else`]: https://rust-lang.github.io/rust-clippy/main/index.html#else_if_without_else
[`clippy::todo`]: https://rust-lang.github.io/rust-clippy/main/index.html#todo
[`clippy::unwrap_used`]: https://rust-lang.github.io/rust-clippy/main/index.html#unwrap_used

---

Expand Down Expand Up @@ -224,11 +224,11 @@ disallowed-names = ["toto", "tata", "titi"]

The [table of configurations](https://doc.rust-lang.org/nightly/clippy/lint_configuration.html)
contains all config values, their default, and a list of lints they affect.
Each [configurable lint](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration)
Each [configurable lint](https://rust-lang.github.io/rust-clippy/main/index.html#Configuration)
, also contains information about these values.

For configurations that are a list type with default values such as
[disallowed-names](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names),
[disallowed-names](https://rust-lang.github.io/rust-clippy/main/index.html#disallowed_names),
you can use the unique value `".."` to extend the default values instead of replacing them.

```toml
Expand Down Expand Up @@ -276,11 +276,11 @@ is equivalent to `msrv = 1.30.0`.

Note: `custom_inner_attributes` is an unstable feature, so it has to be enabled explicitly.

Lints that recognize this configuration option can be found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)
Lints that recognize this configuration option can be found [here](https://rust-lang.github.io/rust-clippy/main/index.html#msrv)

## Contributing

If you want to contribute to Clippy, you can find more information in [CONTRIBUTING.md](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md).
If you want to contribute to Clippy, you can find more information in [CONTRIBUTING.md](https://github.com/rust-lang/rust-clippy/blob/main/CONTRIBUTING.md).

## License

Expand Down
4 changes: 2 additions & 2 deletions book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ title = "Clippy Documentation"
edition = "2024"

[output.html]
edit-url-template = "https://github.com/rust-lang/rust-clippy/edit/master/book/{path}"
git-repository-url = "https://github.com/rust-lang/rust-clippy/tree/master/book"
edit-url-template = "https://github.com/rust-lang/rust-clippy/edit/main/book/{path}"
git-repository-url = "https://github.com/rust-lang/rust-clippy/tree/main/book"
mathjax-support = true
site-url = "/rust-clippy/"

Expand Down
8 changes: 4 additions & 4 deletions book/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
A collection of lints to catch common mistakes and improve your
[Rust](https://github.com/rust-lang/rust) code.

[There are over 800 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
[There are over 800 lints included in this crate!](https://rust-lang.github.io/rust-clippy/HEAD/index.html)

Lints are divided into categories, each with a default [lint
level](https://doc.rust-lang.org/rustc/lints/levels.html). You can choose how
Expand Down Expand Up @@ -38,6 +38,6 @@ on a case-by-case basis before enabling.
- Preventing panicking in certain functions (e.g. [`clippy::unwrap_used`]).
- Running a lint only on a subset of code (e.g. `#[forbid(clippy::float_arithmetic)]` on a module).

[`clippy::else_if_without_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
[`clippy::todo`]: https://rust-lang.github.io/rust-clippy/master/index.html#todo
[`clippy::unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
[`clippy::else_if_without_else`]: https://rust-lang.github.io/rust-clippy/main/index.html#else_if_without_else
[`clippy::todo`]: https://rust-lang.github.io/rust-clippy/main/index.html#todo
[`clippy::unwrap_used`]: https://rust-lang.github.io/rust-clippy/main/index.html#unwrap_used
6 changes: 3 additions & 3 deletions book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ disallowed-names = ["toto", "tata", "titi"]

The [table of configurations](./lint_configuration.md)
contains all config values, their default, and a list of lints they affect.
Each [configurable lint](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration)
Each [configurable lint](https://rust-lang.github.io/rust-clippy/main/index.html#Configuration)
, also contains information about these values.

For configurations that are a list type with default values such as
[disallowed-names](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names),
[disallowed-names](https://rust-lang.github.io/rust-clippy/main/index.html#disallowed_names),
you can use the unique value `".."` to extend the default values instead of replacing them.

```toml
Expand Down Expand Up @@ -132,7 +132,7 @@ is equivalent to `msrv = 1.30.0`.
> enabled explicitly.

Lints that recognize this configuration option can be
found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)
found [here](https://rust-lang.github.io/rust-clippy/main/index.html#msrv)

### Disabling evaluation of certain code

Expand Down
2 changes: 1 addition & 1 deletion book/src/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ book](../lints.md).
[clippy_rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md
[rfc_stability]: https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md#stability-guarantees
[rfc_lint_cats]: https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md#lint-audit-and-categories
[`CONTRIBUTING.md`]: https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md
[`CONTRIBUTING.md`]: https://github.com/rust-lang/rust-clippy/blob/main/CONTRIBUTING.md
14 changes: 7 additions & 7 deletions book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl EarlyLintPass for FooFunctions {}
```

[declare_clippy_lint]: https://github.com/rust-lang/rust-clippy/blob/557f6848bd5b7183f55c1e1522a326e9e1df6030/clippy_lints/src/lib.rs#L60
[example_lint_page]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
[example_lint_page]: https://rust-lang.github.io/rust-clippy/main/index.html#redundant_closure
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
[category_level_mapping]: ../index.html

Expand Down Expand Up @@ -375,7 +375,7 @@ an identifier must appear in a message or label, it should be surrounded with
single grave accents \`.

[check_fn]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html#method.check_fn
[diagnostics]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/diagnostics.rs
[diagnostics]: https://github.com/rust-lang/rust-clippy/blob/main/clippy_utils/src/diagnostics.rs
[the rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/diagnostics.html

## Adding the lint logic
Expand Down Expand Up @@ -603,7 +603,7 @@ necessarily “bad” but are more of a style choice, then replace the
Once your lint is merged, this documentation will show up in the [lint
list][lint_list].

[lint_list]: https://rust-lang.github.io/rust-clippy/master/index.html
[lint_list]: https://rust-lang.github.io/rust-clippy/main/index.html

## Running rustfmt

Expand Down Expand Up @@ -750,10 +750,10 @@ for some users. Adding a configuration is done in the following steps:

Run `cargo bless --test config-metadata` to generate documentation changes for the book.

[`clippy_config::conf`]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_config/src/conf.rs
[`clippy_lints` lib file]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/lib.rs
[`tests/ui`]: https://github.com/rust-lang/rust-clippy/blob/master/tests/ui
[`tests/ui-toml`]: https://github.com/rust-lang/rust-clippy/blob/master/tests/ui-toml
[`clippy_config::conf`]: https://github.com/rust-lang/rust-clippy/blob/main/clippy_config/src/conf.rs
[`clippy_lints` lib file]: https://github.com/rust-lang/rust-clippy/blob/main/clippy_lints/src/lib.rs
[`tests/ui`]: https://github.com/rust-lang/rust-clippy/blob/main/tests/ui
[`tests/ui-toml`]: https://github.com/rust-lang/rust-clippy/blob/main/tests/ui-toml

## Cheat Sheet

Expand Down
14 changes: 7 additions & 7 deletions book/src/development/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ If you've already cloned Clippy in the past, update it to the latest version:
git remote add upstream https://github.com/rust-lang/rust-clippy
# upstream has to be the remote of the rust-lang/rust-clippy repo
git fetch upstream
# make sure that you are on the master branch
git checkout master
# rebase your master branch on the upstream master
git rebase upstream/master
# push to the master branch of your fork
# make sure that you are on the main branch
git checkout main
# rebase your main branch on the upstream main
git rebase upstream/main
# push to the main branch of your fork
git push
```

Expand Down Expand Up @@ -103,7 +103,7 @@ cargo dev dogfood

More about [intellij] command usage and reasons.

[intellij]: https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#rustrover
[intellij]: https://github.com/rust-lang/rust-clippy/blob/main/CONTRIBUTING.md#rustrover

## lintcheck

Expand All @@ -115,7 +115,7 @@ are no false positives and that the suggestions are valid.

Refer to the tools [README] for more details.

[README]: https://github.com/rust-lang/rust-clippy/blob/master/lintcheck/README.md
[README]: https://github.com/rust-lang/rust-clippy/blob/main/lintcheck/README.md

## PR

Expand Down
2 changes: 1 addition & 1 deletion book/src/development/defining_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ Without an entry in one of `early_lint_methods!` or `late_lint_methods!`, the
lint pass in question will not be run.


[all_lints]: https://rust-lang.github.io/rust-clippy/master/
[all_lints]: https://rust-lang.github.io/rust-clippy/main/
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
[Lint Passes]: lint_passes.md
2 changes: 1 addition & 1 deletion book/src/development/emitting_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ cover in the next chapters.
[`span_lint_and_sugg`]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/diagnostics/fn.span_lint_and_sugg.html
[`span_lint_and_then`]: https://doc.rust-lang.org/beta/nightly-rustc/clippy_utils/diagnostics/fn.span_lint_and_then.html
[`clippy_utils::source`]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/source/index.html
[range_plus_one]: https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one
[range_plus_one]: https://rust-lang.github.io/rust-clippy/main/index.html#range_plus_one
[inclusive_range]: https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html
[applicability]: https://doc.rust-lang.org/beta/nightly-rustc/rustc_errors/enum.Applicability.html
[snippet_fn]: https://doc.rust-lang.org/beta/nightly-rustc/clippy_utils/source/fn.snippet.html
Expand Down
12 changes: 6 additions & 6 deletions book/src/development/infrastructure/backport.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ some explanation and are quite subjective. Good judgement is required.
already synced to the Rust repo, the fix doesn't need to be backported, as it
will hit stable together with the commit that introduced the problem. If the
fix PR is not synced yet, the fix PR either needs to be "backported" to the
Rust `master` branch or to `beta` in the next backport cycle.
Rust `main` branch or to `beta` in the next backport cycle.

3. **Make sure that the fix is on `master` before porting to `beta`**
3. **Make sure that the fix is on `main` before porting to `beta`**

The fix must already be synced to the Rust `master` branch. Otherwise, the
next `beta` will be missing this fix again. If it is not yet in `master` it
The fix must already be synced to the Rust `main` branch. Otherwise, the
next `beta` will be missing this fix again. If it is not yet in `main` it
should probably not be backported. If the backport is really important, do an
out-of-cycle sync first. However, the out-of-cycle sync should be small,
because the changes in that sync will get right into `beta`, without being
Expand All @@ -53,7 +53,7 @@ remote in the Rust repository.
After that, fetch the remote with

```bash
git fetch clippy-upstream master
git fetch clippy-upstream main
```

Then, switch to the `beta` branch:
Expand Down Expand Up @@ -84,7 +84,7 @@ Do this for all PRs that should be backported.
## Open PR in the Rust repository

Next, open the PR for the backport. Make sure, the PR is opened towards the
`beta` branch and not the `master` branch. The PR description should look like
`beta` branch and not the `main` branch. The PR description should look like
this:

```
Expand Down
6 changes: 3 additions & 3 deletions book/src/development/infrastructure/benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Having a benchmarking tool directly implemented into lintcheck gives us the
ability to benchmark any given PR just by making a before and after

Here's the way you can get into any PR, benchmark it, and then benchmark
`master`.
`main`.

The first `perf.data` will not have any numbers appended, but any subsequent
benchmark will be written to `perf.data.number` with a number growing for 0.
Expand All @@ -38,10 +38,10 @@ git switch BRANCHNAME
cargo lintcheck --perf

# Get last common commit, checkout that
LAST_COMMIT=$(git log BRANCHNAME..master --oneline | tail -1 | cut -c 1-11)
LAST_COMMIT=$(git log BRANCHNAME..main --oneline | tail -1 | cut -c 1-11)
git switch -c temporary $LAST_COMMIT

# We're now on master
# We're now on main

# Bench
cargo lintcheck --perf
Expand Down
2 changes: 1 addition & 1 deletion book/src/development/infrastructure/book.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ instructions for other options.
## Make changes

The book's
[src](https://github.com/rust-lang/rust-clippy/tree/master/book/src)
[src](https://github.com/rust-lang/rust-clippy/tree/main/book/src)
directory contains all the markdown files used to generate the book. If you
want to see your changes in real time, you can use the mdBook `serve` command to
run a web server locally that will automatically update changes as they are
Expand Down
4 changes: 2 additions & 2 deletions book/src/development/infrastructure/changelog_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ grep -rB1 "pub $LINT_NAME" .
The version shown should match the version of the release the changelog is
written for. If not, update the version to the changelog version.

[changelog]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md
[changelog]: https://github.com/rust-lang/rust-clippy/blob/main/CHANGELOG.md
[forge]: https://forge.rust-lang.org/
[rust_main_tools]: https://github.com/rust-lang/rust/tree/HEAD/src/tools/clippy
[rust_beta_tools]: https://github.com/rust-lang/rust/tree/beta/src/tools/clippy
[rust_stable_tools]: https://github.com/rust-lang/rust/releases
[`beta-accepted`]: https://github.com/rust-lang/rust-clippy/issues?q=label%3Abeta-accepted+
[beta_section]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#unreleased--beta--in-rust-nightly
[beta_section]: https://github.com/rust-lang/rust-clippy/blob/main/CHANGELOG.md#unreleased--beta--in-rust-nightly
Loading