-
Notifications
You must be signed in to change notification settings - Fork 205
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
Puppethack: Validate puppet code before attempting to lint it. #586
base: 3.0.0
Are you sure you want to change the base?
Conversation
I really really like this. And I would love to be able to use Puppet's lexer directly in the future for certain checks. On the other hand, requiring the puppet gem is setting major precedent here. Is it a big deal that we're now pulling in a bunch more dependencies? I'm 👍 👍 👍 on this. |
It's at least a big enough deal to make this a decidedly major version
bump. I'd like to discuss this more on a triage call and then add some
notes here based on the discussion.
|
|
puppet-lint is a linter and not a validator. Invalid code causes many lexing errors.
In yesterday's triage, we discussed the need to support AppOrchestration code in the API, with the code that @binford2k provided. I've added this to the PR. We also discussed the desire to continue processing additional files on the command line when validation of a file fails, but that underlying issue is due to the loop construct bailing early without a rescue inside it (here) which should be tracked separately in #603. |
This is good to review as Ruby 1.8.7 will be out of the matrix soon enough. @binford2k @rodjek |
Would it be possible to add an option to skip the parser validation? I'm currently consuming the puppet-lint gem and I already have checked for a welformed manifest prior to linting. It may also get around the issue of requiring the puppet gem, whereas it could be optional if it exists. |
I think those would both be possible to do, though the puppet gem dependency could be tricky to navigate. |
Yeah, I agree that this should be an optional thing. Wrap the require with |
Doing the |
@rnelson0 Hey, its been a while since this has been updated and I was wondering whether you intended any further work on it? |
@david22swan Not me, personally, I unfortunately do not have the time to participate in this project nearly as much these days. I believe there may have been some improvements that supersede its need anyway, perhaps @rodjek can confirm if that is the case, or if there is already something in the plans. |
There's #728 which adds some error detection and handling. If this PR is to be merged, it'll need to be rebased and de-conflicted with that change first. |
puppet-lint is a linter and not a validator. Invalid code causes many lexing errors.