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

Make error message clearer when the namespace is incorrect #12641

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

maruth-stripe
Copy link
Contributor

@maruth-stripe maruth-stripe commented Jan 22, 2024

Updates the error message when the namespace is incorrect to specify the exact action the developer must take to fix the error.

The error message as it exists today does not immediately signal an action to fix it to developers unfamiliar with Rubocop terminology.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@maruth-stripe maruth-stripe force-pushed the maruth-improve-err-msg branch 3 times, most recently from dec59c7 to 3a7f29b Compare January 22, 2024 19:53
@bbatsov
Copy link
Collaborator

bbatsov commented Jan 24, 2024

I'm on the fence about the proposed message change, as I don't think the old one was unclear. @rubocop/rubocop-core any thoughts?

Copy link
Contributor

@bquorning bquorning left a comment

Choose a reason for hiding this comment

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

I find the new text easier to understand.

Please squash commits though 😅

@koic
Copy link
Member

koic commented Jan 24, 2024

There are pros and cons to both the before and after changes of the message. I don't have a strong opinion on this. It's left to discretion for this.

@maruth-stripe
Copy link
Contributor Author

@bquorning squashed the commits!

@bbatsov Thanks for the feedback! While the old message may not be unclear, developers have told us they would find a message like the new one more clear as it tells them precisely what change to make. Hence, just trying to improve that experience for them :D

@bbatsov bbatsov merged commit 573b23b into rubocop:master Jan 29, 2024
32 checks passed
@bbatsov
Copy link
Collaborator

bbatsov commented Jan 29, 2024

Fair enough. I'm OK with the proposed change.

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

Successfully merging this pull request may close these issues.

4 participants