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 resolving inherit_gem in remote configs #7990

Merged
merged 1 commit into from May 26, 2020

Conversation

CvX
Copy link
Contributor

@CvX CvX commented May 18, 2020

When a file inherits from a url inheriting from a gem, like so:

# .rubocop.yml
inherit_from: http://example.com/default.yml
# http://example.com/default.yml
inherit_gem:
    somegem: default.yml
# somegem's default.yml
Layout/LineLength:
    Max: 48

Rubocop would then incorrectly try to resolve a URL like this:

http://example.com//private/var/folders/69/bjrqv8v1225f7yqnxknm3fb80000gn/T/d20200518-94245-6dqeew/work/gems/somegem/default.yml

With this change, local gem paths are no longer taken by mistake for relative remote paths.


Before submitting the PR make sure the following are checked:

  • 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.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@CvX CvX force-pushed the inherit-from-url-from-gem branch from 0ae0c20 to f8b62e0 Compare May 18, 2020 00:33
@CvX CvX force-pushed the inherit-from-url-from-gem branch from f8b62e0 to 6c979e8 Compare May 23, 2020 23:37
When a file inherits from a url inheriting from a gem, like so:

```yaml
# .rubocop.yml
inherit_from: http://example.com/default.yml
```

```yaml
# http://example.com/default.yml
inherit_gem:
    somegem: default.yml
```

```yaml
# somegem's default.yml
Layout/LineLength:
    Max: 48
```

Rubocop would then incorrectly try to resolve a URL like this:

`http://example.com//private/var/folders/69/bjrqv8v1225f7yqnxknm3fb80000gn/T/d20200518-94245-6dqeew/work/gems/somegem/default.yml`

With this change, local gem paths are no longer taken by mistake for relative remote paths.
@CvX CvX force-pushed the inherit-from-url-from-gem branch from 6c979e8 to f08165d Compare May 25, 2020 14:34
@bbatsov bbatsov merged commit 8f3b950 into rubocop:master May 26, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented May 26, 2020

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.

None yet

2 participants