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 #10174] Fix inherit_from_remote should follow remote includes path starting with ./ #10233

Merged
merged 1 commit into from Nov 10, 2021

Conversation

hirasawayuki
Copy link
Contributor

@hirasawayuki hirasawayuki commented Nov 4, 2021

Fixes #10174.
This PR is fix inherit_from_remote should follow remote includes path starting with ./
In the example of issue, it tries to load ./base.yml in the same hierarchy as ruby-2.7.yml, but the uri of ./base.yml is

https://raw.githubusercontent.com/testdouble/standard/main/config/./base.yml.

If the uri is https:// ~ /./base.yml, ConfigLoaderResolver#remote_file? returns false, so an instance of URI::Generic is created and an error occurs.

In this PR, if remote includes path starts with ./, it will be removed.


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.

@hirasawayuki hirasawayuki force-pushed the fix_inherit_from_remote branch 4 times, most recently from 8063a4a to aa2e515 Compare November 9, 2021 15:25
@hirasawayuki hirasawayuki changed the title [Fix #10174] Fixed an error when inherit_from is a path starting with a dot [Fix #10174] Fix inherit_from_remote should follow remote includes path starting with ./ Nov 9, 2021
@dvandersluis
Copy link
Member

Can you please add tests for this change?

lib/rubocop/remote_config.rb Outdated Show resolved Hide resolved
@koic koic merged commit fa295f0 into rubocop:master Nov 10, 2021
@koic
Copy link
Member

koic commented Nov 10, 2021

Thanks!

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.

remote inherit_from should follow remote includes
3 participants