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

add --top-scope-variables cli argument, fix #228 #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcharaoui
Copy link

Summary

This adds the --top-scope-variables CLI option that sets PuppetLint.configuration.top_scope_variables.

Related Issues (if any)

#228

Checklist

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

@jcharaoui jcharaoui requested review from bastelfreak and a team as code owners January 23, 2025 23:38
@@ -0,0 +1,4 @@
# foo
Copy link

Choose a reason for hiding this comment

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

Can you remove this?

Copy link
Author

Choose a reason for hiding this comment

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

I can remove it, but the test will fail with [documentation] defined type not documented.

Copy link
Author

Choose a reason for hiding this comment

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

Also, I simply copied this # foo header from other similar test manifest fixtures, eg. spec/fixtures/test/manifests/fail.pp and spec/fixtures/test/manifests/init.pp and others.

Choose a reason for hiding this comment

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

We are trying to avoid this type of meaningless documentation. If a one-liner description doesn't make sense for this function then feel free to remove the entire comment and let Rubocop add it to the list of exceptions by running bundle exec rubocop --auto-gen-config.

@jcharaoui jcharaoui force-pushed the top_scope_facts_cli branch from da71597 to f4a94d3 Compare January 30, 2025 13:22
@jcharaoui
Copy link
Author

Removed an extra blank line.

@jcharaoui
Copy link
Author

Not sure how to deal with this issue, though:

spec (ruby 3.3) / spec: lib/puppet-lint/optparser.rb#L20
Metrics/MethodLength: Method has too many lines. [111/108]

@LukasAud
Copy link

Not sure how to deal with this issue, though:

spec (ruby 3.3) / spec: lib/puppet-lint/optparser.rb#L20
Metrics/MethodLength: Method has too many lines. [111/108]

Manually adjusting the Metrics/MethodLength variable in the rubocop_todo.yml file should do the trick. Alternatively, you can run bundle exec rubocop --auto-gen-config to have Rubocop regenerate the file with the new exception.

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.

3 participants