add ignore option to pyflakes check

Review Request #3569 — Created March 12, 2016 and submitted

cheister
pants
add-pyflakes-ignore-option
3041
pants-reviews
molsen, nhoward_tw, zundel
add ignore option to pyflakes check

Add ignore option to pyflakes style check that is similar to the ignore option for the PEP8 style check

Using the option in pants.ini looks like

[pycheck-pyflakes]
ignore: [
    'F401'  # module imported but unused
  ]

Travis CI: https://travis-ci.org/pantsbuild/pants/builds/115593092

  1. Just some non-binding comments

  2. you can shorten this to

    ignore_option = options.get('ignore') or []
    

    which means you could shorten the whole method to a one-liner if you wanted to:

      def get_plugin(self, file_content, **options):
        return super(PyflakesCheckerTest, self).get_plugin(file_content, ignore=options.get('ignore') or [])
    
  3. nit: Could you extend assertNoNits to pass down an ignore option?

  4. 
      
  1. Ship It!
  2. 
      
  1. Thanks for the patch Chris and for the review Nick. In master @ 978cc60. Please close this RB as submitted and close the associated PRs in github.

  2. 
      
Review request changed

Status: Closed (submitted)

Loading...