8479b6a979a0433c9b360c340fca454f03b0ff77,contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/checker.py,PythonCheckStyleTask,get_nits,#PythonCheckStyleTask#Any#,96

Before Change


          yield nit
          continue

        nit_slice = python_file.line_range(nit._line_number)
        for line_number in range(nit_slice.start, nit_slice.stop):
          if noqa_line_filter(python_file, line_number):
            break
          else:
            yield nit

  def check_file(self, filename):
    Process python file looking for indications of problems.

    :param filename: (str) Python source filename

After Change


    :param filename: str pointing to a file within the buildroot.
    
    try:
      python_file = PythonFile.parse(filename, root=get_buildroot())
    except CheckSyntaxError as e:
      yield e.as_nit()
      return

    if noqa_file_filter(python_file):
      return

    if self.options.suppress:
      // Filter out any suppressed plugins
      check_plugins = [plugin for plugin in self._plugins
                       if self.excluder.should_include(filename, plugin.name)]
    else:
      check_plugins = self._plugins

    for plugin in check_plugins:

      for i, nit in enumerate(plugin.checker(python_file)):
        if i == 0:
          // NB: Add debug log header for nits from each plugin, but only if there are nits from it.
          self.context.log.debug("Nits from plugin {} for {}".format(plugin.name, filename))

        if not nit.has_lines_to_display:
          yield nit
          continue

        if all(not line_contains_noqa(line) for line in nit.lines):
          yield nit

  def check_file(self, filename):
    Process python file looking for indications of problems.

    :param filename: (str) Python source filename
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pantsbuild/pants
Commit Name: 8479b6a979a0433c9b360c340fca454f03b0ff77
Time: 2016-04-07
Author: nhoward@twopensource.com
File Name: contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/checker.py
Class Name: PythonCheckStyleTask
Method Name: get_nits


Project Name: pantsbuild/pants
Commit Name: 24d8a1652b3bf99115c67ba9f47e06b172fe8e00
Time: 2015-10-09
Author: john.sirois@gmail.com
File Name: src/python/pants/engine/exp/mapper.py
Class Name: AddressMap
Method Name: parse


Project Name: graphbrain/graphbrain
Commit Name: b354803b038659359816213443108cf0ee18f74a
Time: 2020-01-08
Author: telmo@telmomenezes.net
File Name: graphbrain/agents/txt_parser.py
Class Name: TxtParser
Method Name: input_file