puppetlabs / puppet-lint

Check that your Puppet manifests conform to the style guide
https://puppetlabs.github.io/puppet-lint/
MIT License
18 stars 12 forks source link

Create a new plugin for ensuring a single space before a '=>' #175

Closed gerases closed 4 months ago

gerases commented 8 months ago

This will trigger a warning only for resources with single parameters such as:

file { 'foo':
  ensure⎵⎵=> file,
}

Summary

Create a new plugin for ensuring a single space before a '=>' in resources with a single parameter. Arrow alignment for resources with multiple parameters (including detecting extra white space before the arrow) is already done in the arrow_alignment plugin.

Checklist

CLAassistant commented 8 months ago

CLA assistant check
All committers have signed the CLA.

bastelfreak commented 8 months ago

Hi, are you aware of https://rubygems.org/gems/puppet-lint-strict_indent-check ? It also checks the alignment

gerases commented 8 months ago

Hi, are you aware of https://rubygems.org/gems/puppet-lint-strict_indent-check ? It also checks the alignment

Yes, I do have that installed but it wasn't catching this situation.

jordanbreen28 commented 4 months ago

@gerases apologies for the such late response.. I've left a couple of comments above. Could you address those and we can try get this moving? We also need you to sign the CLA. Thanks for your work on this :)

gerases commented 4 months ago

@gerases apologies for the such late response..

@jordanbreen28 , ah, good point -- just changed and pushed -- is that better?

codecov[bot] commented 4 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (05af720) 93.15% compared to head (82ecfc7) 93.19%.

Files Patch % Lines
...int/plugins/check_whitespace/space_before_arrow.rb 95.83% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #175 +/- ## ========================================== + Coverage 93.15% 93.19% +0.03% ========================================== Files 54 55 +1 Lines 1768 1792 +24 ========================================== + Hits 1647 1670 +23 - Misses 121 122 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jordanbreen28 commented 4 months ago

@gerases could you sign the CLA? I've tested this locally and all works like a charm :)

gerases commented 4 months ago

@gerases could you sign the SLA? I've tested this locally and all works like a charm :)

I think I did but it's still saying pending?

jordanbreen28 commented 4 months ago

@gerases ah! its been known to do this.

jordanbreen28 commented 4 months ago

re-opening

jordanbreen28 commented 4 months ago

Looks like this is the issue https://github.com/cla-assistant/cla-assistant/issues/562#issuecomment-619914668 You need to set your email via git config and then commit

gerases commented 4 months ago

Looks like this is the issue cla-assistant/cla-assistant#562 (comment) You need to set your email via git config and then commit

okeedok, working on this right now

gerases commented 4 months ago

Hmm, i can't seem to do anything here, should close the PR and create a new one?

jordanbreen28 commented 4 months ago

Hmm, i can't seem to do anything here, should close the PR and create a new one?

@gerases It looks like you're commits are authored by a different email/user than your PR was created with (which is probably what you used to sign the CLA) 😃

gerases commented 4 months ago

Yeah, needed to rewrite the commits, should be good now

gerases commented 4 months ago

@bastelfreak, can you approve

jordanbreen28 commented 4 months ago

Thanks for your contribution @gerases 😁

gerases commented 4 months ago

@jordanbreen28 , happy to contribute! Thank you all as well!