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

Adding soft-tab-width option #87

Closed
wants to merge 1 commit into from

Conversation

jasonhancock
Copy link

Tim,

I'm still a ruby n00b, so please adjust or reject this if it isn't to your liking.

@jasonhancock
Copy link
Author

Tim,

Is there anything else I need to do to get this included in the next revision?

@vStone
Copy link
Contributor

vStone commented Sep 6, 2012

Since the style guide actually indicates we should use 2 spaces as soft tabs, its probably better to just ignore this check.

@rharrison10
Copy link

vStone, the community style guide does indicate two space soft tabs but I've already seen two organizations where the internal policy states something to the effect of "Manifest will comply with the Puppet style guide, with the exception of using four space soft tabs instead of two space tabs." I personally prefer the smaller tabs but it would still be nice for groups that have a different opinion to be able to check for their guidelines.

@vStone
Copy link
Contributor

vStone commented Sep 28, 2012

FYI: With the current code, using 4 spaces should not return an error since the only check being done is if the number of spaces is an even number. See #153.

@hcgrove
Copy link

hcgrove commented Jan 16, 2013

You're right that the current code won't complain if 4 space soft tabs are used, but it won't complain if a line is indented with e.g. 6 spaces, which would be wrong if you want 4 space soft tabs.

And we not going to abandon our own policy on indentation just because some software we like has a style guide saying something else (you can probably find projects that recommand using 3 space soft tabs, so that basically wouldn't make sense), but we would like to use a nice tool that puppet-lint to make sure our puppet manifests look right. We can get a long way with the current version but a soft-tab-width option would bring us one step further.

I don't like ruby, so I'm not going to try to find out how to pass the value around, but the only real code change would be line 62 in lib/puppet-lint/plugins/check_whitespace.rb where 2 should be replaced by a variable that should have a default of 2 but be configurable via an option (that would be added in lib/puppet-lint/bin.rb).

@ghoneycutt
Copy link
Contributor

2 spaces is what the style guide reads, so +1 to keeping that the default.

also +1 to making it configurable. I ensured the style guide was versioned and each section numbered exactly so that you can say as @rharrison10 states, we comply with the current style guide, except section 6, because we think 3 space indention is l33t, or whatever :)

ekohl pushed a commit to ekohl/puppet-lint that referenced this pull request Feb 23, 2023
…irement

(CONT-339) Lower Ruby requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants