Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have different docs for nightly/beta/stable channels #3455

Open
matthiaskrgr opened this issue Nov 25, 2018 · 4 comments
Open

have different docs for nightly/beta/stable channels #3455

matthiaskrgr opened this issue Nov 25, 2018 · 4 comments
Assignees
Labels
A-infra Area: CI issues and issues that require full access for GitHub/CI A-website Area: Improving the clippy website
Milestone

Comments

@matthiaskrgr
Copy link
Member

Currently clippy suggestion urls point to mostly the same page regardless of rustc release channel

stable:

    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#unreadable_literal

beta:

    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#unnecessary_mut_passed

nightly:

    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal

If a lint gets removed/downgraded in the current master branch and the docs get updates, the clippy version used on stable might not reflect this but still points to the master docs.
I think we need separate docs for nightly/stable/beta branches of the compiler.
Perhaps we can use separate branches for each release (like 1.30) or channel?

@matthiaskrgr
Copy link
Member Author

Perhaps we could solve this by universally baking the current commit hash into the url used by the docs, but then again I think docs are not regenerated on every commit?

@matthiaskrgr
Copy link
Member Author

Or we could probably fix this by sort of pinning the clippy version to the one of rustc so that version-specific docs are released for every rustc channel.
clippy 0.0.212-1.30

@oli-obk
Copy link
Contributor

oli-obk commented Nov 26, 2018

Or we could probably fix this by sort of pinning the clippy version to the one of rustc so that version-specific docs are released for every rustc channel.

That's what I implemented, but it's not working

@phansch phansch added this to the 1.0 milestone Dec 2, 2018
@phansch phansch added A-infra Area: CI issues and issues that require full access for GitHub/CI A-website Area: Improving the clippy website labels Dec 2, 2018
@oli-obk oli-obk self-assigned this Dec 12, 2018
@matthiaskrgr
Copy link
Member Author

fn docs_link(diag: &mut DiagnosticBuilder<'_>, lint: &'static Lint) {
    if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
        if let Some(lint) = lint.name_lower().strip_prefix("clippy::") {
            diag.help(&format!(
                "for further information visit https://rust-lang.github.io/rust-clippy/{}/index.html#{}",
                &option_env!("RUST_RELEASE_NUM").map_or("master".to_string(), |n| {
                    // extract just major + minor version and ignore patch versions
                    format!("rust-{}", n.rsplitn(2, '.').nth(1).unwrap())
                }),
                lint
            ));
        }
    }
}

No idea where RUST_RELEASE_NUM is coming from, it does not seem to be documented anywhere 😆
Is there a replacement for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infra Area: CI issues and issues that require full access for GitHub/CI A-website Area: Improving the clippy website
Projects
None yet
Development

No branches or pull requests

3 participants