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

We shouldn't strip blank comments in code in lint doc generation #4116

Closed
Manishearth opened this issue May 20, 2019 · 1 comment · Fixed by #4229
Closed

We shouldn't strip blank comments in code in lint doc generation #4116

Manishearth opened this issue May 20, 2019 · 1 comment · Fixed by #4229
Labels
A-documentation Area: Adding or improving documentation C-bug Category: Clippy is not doing the correct thing

Comments

@Manishearth
Copy link
Member

See https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr

The blank lines in the source (important for this lint) are removed from the docs, since the doc generation step strips empty lines (before hitting any kind of markdown parser)

I'm not quite sure why we do that at all, but we shouldn't be doing it within code.

(It's late so I haven't yet investigated)

@Manishearth Manishearth added C-bug Category: Clippy is not doing the correct thing A-documentation Area: Adding or improving documentation labels May 20, 2019
@phansch
Copy link
Member

phansch commented May 20, 2019

This bug sounds vaguely familiar. I believe the bug is somewhere in

def parse_lint_def(lint):

or here:

else:
m = comment_re.search(line)
if m:
comment.append(m.group(1))

For anyone investigating, comment in lintlib.py is called doc in export.py.

bors added a commit that referenced this issue Jul 10, 2019
don't strip blank lines in lint documentation

changelog: don't strip blank lines in lint documentation

Fixes #4116.

This PR also switches the docs headings to deterministically display in the order that they are declared in the source, with "Configuration" always appearing last. It doesn't seem like there was a defined order before.
bors added a commit that referenced this issue Jul 11, 2019
don't strip blank lines in lint documentation

changelog: don't strip blank lines in lint documentation

Fixes #4116.

This PR also switches the docs headings to deterministically display in the order that they are declared in the source, with "Configuration" always appearing last. It doesn't seem like there was a defined order before.
flip1995 added a commit to flip1995/rust-clippy that referenced this issue Jul 12, 2019
…ip1995

don't strip blank lines in lint documentation

changelog: don't strip blank lines in lint documentation

Fixes rust-lang#4116.

This PR also switches the docs headings to deterministically display in the order that they are declared in the source, with "Configuration" always appearing last. It doesn't seem like there was a defined order before.
bors added a commit that referenced this issue Jul 12, 2019
don't strip blank lines in lint documentation

changelog: don't strip blank lines in lint documentation

Fixes #4116.

This PR also switches the docs headings to deterministically display in the order that they are declared in the source, with "Configuration" always appearing last. It doesn't seem like there was a defined order before.
bors added a commit that referenced this issue Jul 12, 2019
don't strip blank lines in lint documentation

changelog: don't strip blank lines in lint documentation

Fixes #4116.

This PR also switches the docs headings to deterministically display in the order that they are declared in the source, with "Configuration" always appearing last. It doesn't seem like there was a defined order before.
bors added a commit that referenced this issue Jul 13, 2019
don't strip blank lines in lint documentation

changelog: don't strip blank lines in lint documentation

Fixes #4116.

This PR also switches the docs headings to deterministically display in the order that they are declared in the source, with "Configuration" always appearing last. It doesn't seem like there was a defined order before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants