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

fix: component-name-unique rule should report location #1759

Merged
merged 12 commits into from
Oct 28, 2024

Conversation

pboos
Copy link
Contributor

@pboos pboos commented Oct 10, 2024

What/Why/How?

What: This sets the location on the reported problem & makes the message one line instead of multiple lines.

Why: The component-name-unique didn't report any location. That location is specifically useful when using the ignore file. The message is more aligned with the other reports.

How: By using passing the location and reporting it instead of just passing the absolutePointer.

Reference

Testing

See updated test code.

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@pboos pboos requested a review from a team as a code owner October 10, 2024 09:00
Copy link

changeset-bot bot commented Oct 10, 2024

🦋 Changeset detected

Latest commit: a774fda

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Minor
@redocly/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pboos pboos requested a review from a team as a code owner October 10, 2024 09:43
@tatomyr
Copy link
Contributor

tatomyr commented Oct 21, 2024

Thank you for the contribution @pboos! I'll take a look into this once I have time.

Copy link
Contributor

@lornajane lornajane left a comment

Choose a reason for hiding this comment

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

This a nice improvement to have the accurate location of one of the duplicates. I added a couple of comments about keeping the output formatting, and removing some commented code, could you take a look?

packages/core/src/rules/oas3/component-name-unique.ts Outdated Show resolved Hide resolved
packages/core/src/rules/oas3/component-name-unique.ts Outdated Show resolved Hide resolved
@pboos pboos requested a review from lornajane October 25, 2024 14:48
Copy link
Contributor

@lornajane lornajane left a comment

Choose a reason for hiding this comment

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

Thanks @pboos , this is definitely an improvement :)

@lornajane
Copy link
Contributor

Also tagging @tatomyr - do we need to update some test snapshots to go with this change?

Copy link
Contributor

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

Looks great! Left one small style comment.

packages/core/src/rules/oas3/component-name-unique.ts Outdated Show resolved Hide resolved
@tatomyr tatomyr force-pushed the bugfix/component-name-unique-location branch from 6ede57d to a774fda Compare October 28, 2024 15:03
Copy link
Contributor

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

LGTM. I'm going to merge this PR soon.
Thank you very much @pboos for making Redocly CLI better!

@tatomyr tatomyr merged commit c930fa3 into Redocly:main Oct 28, 2024
37 checks passed
@tatomyr tatomyr mentioned this pull request Oct 30, 2024
5 tasks
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.

3 participants