Skip to content

Conversation

@faeroon
Copy link

@faeroon faeroon commented Jan 24, 2026


implemented new check getter prefixes lint and meet UI test error

changelog: [getter_prefixes]

  • Followed [lint naming conventions][lint_naming]
  • Added passing UI tests (including committed .stderr file)
  • cargo test passes locally
  • Executed cargo dev update_lints
  • Added lint documentation
  • Run cargo dev fmt

I implemented #1673 resolved existing todos in comments of previous PR #3616, created UI test for new lint and updated getter methods in existing UI tests. Everything seems worked except strange failure from new UI test, even after cargo uibless (stderr output looks legit).

error: there was 1 unmatched diagnostic
 --> tests/ui/getter_prefixes.rs:6:8
  |
6 |     fn get_id(&self) -> usize;
  |        ^^^^^^ Error[clippy::getter_prefixes]: prefixing a getter with `get_` does not follow naming conventions
  |

error: there was 1 unmatched diagnostic
  --> tests/ui/getter_prefixes.rs:60:12
   |
60 |     pub fn get_id(&self) -> usize {
   |            ^^^^^^ Error[clippy::getter_prefixes]: prefixing a getter with `get_` does not follow naming conventions
   |

error: expected error patterns, but found none

full stderr:
error: prefixing a getter with `get_` does not follow naming conventions
  --> tests/ui/getter_prefixes.rs:6:8
   |
LL |     fn get_id(&self) -> usize;
   |        ^^^^^^ help: replace it with: `id`
   |
   = note: `-D clippy::getter-prefixes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::getter_prefixes)]`

error: prefixing a getter with `get_` does not follow naming conventions
  --> tests/ui/getter_prefixes.rs:60:12
   |
LL |     pub fn get_id(&self) -> usize {
   |            ^^^^^^ help: replace it with: `id`

error: aborting due to 2 previous errors


full stdout:


FAILURES:
    tests/ui/getter_prefixes.rs

test result: FAIL. 1 failed; 1727 passed; 6 ignored

@rustbot rustbot added needs-fcp S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jan 24, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 24, 2026

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@github-actions
Copy link

github-actions bot commented Jan 24, 2026

Lintcheck changes for e58481e

Lint Added Removed Changed
clippy::getter_prefixes 645 0 0

This comment will be updated if you push new changes

@faeroon faeroon marked this pull request as draft January 24, 2026 19:51
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 24, 2026
@faeroon
Copy link
Author

faeroon commented Jan 24, 2026

Sorry, false alarm. I've added missing comment annotations and now UI tests passed. But dogfood tests are failing now because of existing getters in linters. I started renaming but because of affecting some core methods like SpanRangeExt.get_source_text diff quickly became too big (60+ files). And I decided to ask before further changes: is it worth it? Or it's better to review lint conditions and make it more strict somehow?

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