Skip to content

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

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

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

gerases
Copy link

@gerases gerases commented Nov 1, 2023

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

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@gerases gerases requested review from bastelfreak and a team as code owners November 1, 2023 18:24
@CLAassistant
Copy link

CLAassistant commented Nov 1, 2023

CLA assistant check
All committers have signed the CLA.

@bastelfreak
Copy link
Collaborator

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

@gerases gerases force-pushed the space_before_arrow branch from 0207c1f to d4cdfad Compare November 1, 2023 18:47
@gerases
Copy link
Author

gerases commented Nov 1, 2023

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.

@gerases gerases force-pushed the space_before_arrow branch 2 times, most recently from a53c2f2 to b472b54 Compare November 1, 2023 20:33
@jordanbreen28 jordanbreen28 added the feature New feature or request label Feb 9, 2024
@jordanbreen28
Copy link

jordanbreen28 commented Feb 9, 2024

@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
Copy link
Author

gerases commented Feb 9, 2024

@gerases apologies for the such late response..

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

Copy link

codecov bot commented Feb 9, 2024

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 ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# bar => 'baz',
# }
#
# is handled by the "arrow_alignment") plugin.
Copy link
Collaborator

Choose a reason for hiding this comment

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

the ) looks a bit odd.

Copy link
Author

Choose a reason for hiding this comment

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

good catch, fixed

@gerases gerases force-pushed the space_before_arrow branch 2 times, most recently from 2210858 to c0426cd Compare February 9, 2024 15:05
@jordanbreen28
Copy link

jordanbreen28 commented Feb 9, 2024

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

@gerases
Copy link
Author

gerases commented Feb 9, 2024

@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
Copy link

@gerases ah! its been known to do this.

@jordanbreen28
Copy link

re-opening

@jordanbreen28 jordanbreen28 reopened this Feb 9, 2024
@jordanbreen28
Copy link

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

@gerases gerases force-pushed the space_before_arrow branch 2 times, most recently from 6df6783 to 8640cb3 Compare February 9, 2024 16:12
@gerases
Copy link
Author

gerases commented Feb 9, 2024

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 gerases force-pushed the space_before_arrow branch from 0d7b8f9 to 8640cb3 Compare February 9, 2024 16:28
@gerases
Copy link
Author

gerases commented Feb 9, 2024

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

@jordanbreen28
Copy link

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) 😃

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

```
file { 'foo':
  ensure⎵⎵=> file,
}
```
@gerases gerases force-pushed the space_before_arrow branch from 1407256 to 5bee2bc Compare February 9, 2024 17:19
@gerases
Copy link
Author

gerases commented Feb 9, 2024

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

@gerases
Copy link
Author

gerases commented Feb 9, 2024

@bastelfreak, can you approve

@bastelfreak bastelfreak merged commit d0e5560 into puppetlabs:main Feb 9, 2024
@jordanbreen28
Copy link

Thanks for your contribution @gerases 😁

@gerases
Copy link
Author

gerases commented Feb 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants