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

Split checking and reporting logic #227

Merged
merged 4 commits into from Jan 5, 2014
Merged

Split checking and reporting logic #227

merged 4 commits into from Jan 5, 2014

Conversation

rodjek
Copy link
Owner

@rodjek rodjek commented Sep 24, 2013

This will allow the linting logic to be used separately within Ruby without printing unnecessary garbage to stdout.

irb(main):001:0> require 'puppet-lint'
=> true
irb(main):002:0> l = PuppetLint.new
=> #<PuppetLint:0x10ef12fe8 @manifest="", @code=nil, @statistics={:warning=>0, :error=>0, :fixed=>0}>
irb(main):003:0> l.code = File.read('../test.pp')
=> "class test { }\n"
irb(main):004:0> l.path = "../test.pp"
=> "../test.pp"
irb(main):005:0> l.run
=> nil
irb(main):006:0> l.problems
=> [{:path=>"../test.pp", :kind=>:error, :message=>"test not in autoload module layout", :fullpath=>"/Users/tsharpe/code/puppet-lint/test.pp", :linenumber=>1, :column=>7, :check=>:autoloader_layout, :file
name=>"test.pp"}, {:path=>"../test.pp", :kind=>:warning, :message=>"class not documented", :fullpath=>"/Users/tsharpe/code/puppet-lint/test.pp", :linenumber=>1, :column=>1, :check=>:documentation, :filena
me=>"test.pp"}]

/cc #124

@petems
Copy link
Contributor

petems commented Sep 24, 2013

👍

Conflicts:
	lib/puppet-lint/checkplugin.rb
	spec/puppet-lint/plugins/check_classes/autoloader_layout_spec.rb
	spec/spec_helper.rb
rodjek pushed a commit that referenced this pull request Jan 5, 2014
Split checking and reporting logic
@rodjek rodjek merged commit 233a72b into master Jan 5, 2014
@rodjek rodjek deleted the move_output_out_of_lib branch January 5, 2014 11:34
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.

None yet

2 participants