Skip to content

[BUGFIX] Set line number for addRule() with only column number #1265

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

JakeQZ
Copy link
Collaborator

@JakeQZ JakeQZ commented May 28, 2025

Continue to preserve the column number.
Also tighten the test to confirm the Rule is added at the end.

Note that the reason for markTestSkipped() was incorrect - the line number was not being set at all.

@JakeQZ JakeQZ requested a review from oliverklee May 28, 2025 17:43
@JakeQZ JakeQZ self-assigned this May 28, 2025
@coveralls
Copy link

coveralls commented May 28, 2025

Coverage Status

coverage: 57.135% (+0.02%) from 57.111%
when pulling 1989727 on bugfix/addrule/columnnumber
into be60456 on main.

Continue to preserve the column number.
Also tighten the test to confirm the `Rule` is added at the end.

Note that the reason for `markTestSkipped()` was incorrect - the line number
was not being set at all.

Part of #974.
@JakeQZ JakeQZ force-pushed the bugfix/addrule/columnnumber branch from 296490a to 1989727 Compare May 28, 2025 23:17
@JakeQZ JakeQZ changed the title [BUGFIX] Set line number for AddRule() with only column number [BUGFIX] Set line number for addRule() with only column number Jun 2, 2025
@oliverklee oliverklee merged commit 4012ec5 into main Jun 3, 2025
21 checks passed
@oliverklee oliverklee deleted the bugfix/addrule/columnnumber branch June 3, 2025 07:54
JakeQZ added a commit that referenced this pull request Jun 4, 2025
This is the backport of #1263, #1262 and #1265.

Since `getLineNo()` and `getColNo()`, which always returned an `int`, are
deprecated, using their replacements, which may return `null`, for `Rule`s in
a `RuleSet` may cause issues.
The fixes ensure that such `Rule`s will always have a valid position, so the
new methods will not return `null` in that situation, and a straightforward
replacement can be done.

Part of #974.
JakeQZ added a commit that referenced this pull request Jun 4, 2025
This is the backport of #1263, #1262 and #1265.

Since `getLineNo()` and `getColNo()`, which always returned an `int`, are
deprecated, using their replacements, which may return `null`, for `Rule`s in
a `RuleSet` may cause issues.
The fixes ensure that such `Rule`s will always have a valid position, so the
new methods will not return `null` in that situation, and a straightforward
replacement can be done.

Part of #974.
JakeQZ added a commit that referenced this pull request Jun 4, 2025
This is the backport of #1263, #1262 and #1265.

Since `getLineNo()` and `getColNo()`, which always returned an `int`, are
deprecated, using their replacements, which may return `null`, for `Rule`s in
a `RuleSet` may cause issues.
The fixes ensure that such `Rule`s will always have a valid position, so the
new methods will not return `null` in that situation, and a straightforward
replacement can be done.

Part of #974.
oliverklee pushed a commit that referenced this pull request Jun 4, 2025
This is the backport of #1263, #1262 and #1265.

Since `getLineNo()` and `getColNo()`, which always returned an `int`, are
deprecated, using their replacements, which may return `null`, for `Rule`s in
a `RuleSet` may cause issues.
The fixes ensure that such `Rule`s will always have a valid position, so the
new methods will not return `null` in that situation, and a straightforward
replacement can be done.

Part of #974.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants