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

(CONT-214) Fix rubocop inheritance #70

Merged
merged 1 commit into from
Jan 17, 2023
Merged

Conversation

chelnak
Copy link

@chelnak chelnak commented Oct 21, 2022

Prior to this PR we attempted to configure the puppet-lint gem so downstream plugin authors could consume rubocops config via the gem.

This mostly worked however there seemed to be an issue when inheriting AllCops/Exclude properties.

tldr; inheriting a config called .rubocop.yml doesn't seem to work as expected.

This PR attempts to solve that by splitting out the main rules for puppet-lint in to a new file called rubocop_baseline.yml. Them, .rubocop.yml has been configured to inherit from this file.

This means that puppet-lint can continue to operate as normal.

The gemspec entry for .rubocop.yml has been replaced with rubocop_baseline.yml. This ensures that we are packaging the baselines config with the puppet-lint gem.

Downstream plugins can then inherit this configuration like this:

inherit_gem:
  puppet-lint:
    - rubocop_baseline.yml

This appears to pull in the AllCops/Exclude properties as expected.

@chelnak chelnak added the bug Something isn't working label Oct 21, 2022
@chelnak chelnak requested a review from a team as a code owner October 21, 2022 08:45
@chelnak chelnak self-assigned this Oct 21, 2022
.rubocop.yml Show resolved Hide resolved
Copy link

@GSPatton GSPatton left a comment

Choose a reason for hiding this comment

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

looks good

rubocop_baseline.yml Outdated Show resolved Hide resolved
Prior to this commit we attempted to configure the puppet-lint gem so
downstream plugin authors could consume rubocops config via the gem.

This mostly worked however there seemed to be an issue when inheriting
`AllCops/Exclude` properties.

tldr; inheriting a config called `.rubocop.yml` doesn't seem to work as
expected.

This commit attempts to solve that by splitting out the main rules for
puppet-lint in to a new file called `rubocop_baseline.yml`. Them,
.rubocop.yml has been configured to inherit from this file.

This means that puppet-lint can continue to operate as normal.

The `gemspec` entry for `.rubocop.yml` has been replaced with
`rubocop_baseline.yml`. This ensures that we are packaging the baselines
config with the puppet-lint gem.

Downstream plugins can then inherit this configuration like this:

```
inherit_gem:
  puppet-lint:
    - rubocop_baseline.yml
```

This appears to pull in the `AllCops/Exclude` properties as expected.
@chelnak chelnak force-pushed the CONT-214-rubocop_inheritance branch from b18c3e6 to 092aa48 Compare October 21, 2022 11:00
Copy link

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I'd like a 3.0.2 release that includes this and the other PRs I opened.

@chelnak
Copy link
Author

chelnak commented Jan 16, 2023

Sure we can get this sorted soon.

@GSPatton GSPatton merged commit 06f93da into main Jan 17, 2023
@GSPatton GSPatton deleted the CONT-214-rubocop_inheritance branch January 17, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants