Skip to content

[Merged by Bors] - chore: handle comment nesting in lint-style.py - #10994

Closed
thorimur wants to merge 2 commits into
masterfrom
lint-backarrow-fix
Closed

thorimur wants to merge 2 commits into
masterfrom
lint-backarrow-fix

Conversation

@thorimur

@thorimur thorimur commented Feb 26, 2024 •

Copy link
Copy Markdown
Contributor

This PR adjusts annotate_comments to respect comment nesting while linting.

Note that annotate_strings does not necessarily respect comment nesting, so this is an improvement, not a full fix. (Likewise, annotate_comments (still) doesn't ignore comment markers in strings.)

See Zulip.


This issue appeared when the "space after "←"" linter was activated within a docstring (hence the branch name); see #10991. The latter half had been considered "not in a comment" too early due to the presence of -/ in a code block earlier in that docstring (which set in_comment to False).

Open in Gitpod

@thorimur thorimur closed this Feb 26, 2024
@thorimur thorimur changed the title chore: don't lint against ← followed by a backtick chore: handle comment nesting in lint-style.py Feb 27, 2024
@thorimur thorimur reopened this Feb 27, 2024
@thorimur thorimur mentioned this pull request Feb 28, 2024
2 tasks done

@jcommelin jcommelin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉

bors merge

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Mar 26, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Mar 26, 2024
This PR adjusts `annotate_comments` to respect comment nesting while linting.

Note that `annotate_strings` does not necessarily respect comment nesting, so this is an improvement, not a full fix. (Likewise, `annotate_comments` (still) doesn't ignore comment markers in strings.)

See [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/False.20positive.20on.20.60.E2.86.90.60.20style.20linter).
@mathlib-bors

mathlib-bors Bot commented Mar 26, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore: handle comment nesting in lint-style.py [Merged by Bors] - chore: handle comment nesting in lint-style.py Mar 26, 2024
@mathlib-bors mathlib-bors Bot closed this Mar 26, 2024
@mathlib-bors
mathlib-bors Bot deleted the lint-backarrow-fix branch March 26, 2024 09:53
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
This PR adjusts `annotate_comments` to respect comment nesting while linting.

Note that `annotate_strings` does not necessarily respect comment nesting, so this is an improvement, not a full fix. (Likewise, `annotate_comments` (still) doesn't ignore comment markers in strings.)

See [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/False.20positive.20on.20.60.E2.86.90.60.20style.20linter).
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
This PR adjusts `annotate_comments` to respect comment nesting while linting.

Note that `annotate_strings` does not necessarily respect comment nesting, so this is an improvement, not a full fix. (Likewise, `annotate_comments` (still) doesn't ignore comment markers in strings.)

See [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/False.20positive.20on.20.60.E2.86.90.60.20style.20linter).
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
This PR adjusts `annotate_comments` to respect comment nesting while linting.

Note that `annotate_strings` does not necessarily respect comment nesting, so this is an improvement, not a full fix. (Likewise, `annotate_comments` (still) doesn't ignore comment markers in strings.)

See [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/False.20positive.20on.20.60.E2.86.90.60.20style.20linter).
callesonne pushed a commit that referenced this pull request Apr 22, 2024
This PR adjusts `annotate_comments` to respect comment nesting while linting.

Note that `annotate_strings` does not necessarily respect comment nesting, so this is an improvement, not a full fix. (Likewise, `annotate_comments` (still) doesn't ignore comment markers in strings.)

See [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/False.20positive.20on.20.60.E2.86.90.60.20style.20linter).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants