tools/traffic_annotation/scripts/check_annotations.py
def CheckFiles(self, complete_run, limit, use_python_auditor):
    """Passes all given files to traffic_annotation_auditor to be checked for
    possible violations of network traffic annotation rules.

    Args:
      complete_run: bool Flag requesting to run test on all relevant files.
      use_python_auditor: bool If True, test auditor.py instead of
        t_a_auditor.exe.
      limit: int The upper threshold for number of errors and warnings. Use 0
          for unlimited.

    Returns:
      int Exit code of the network traffic annotation auditor.
    """
    if not self.tools.CanRunAuditor(use_python_auditor):
      print("Network traffic annotation presubmit check was not performed. A "
            "compiled build directory and traffic_annotation_auditor binary "
            "are required to do it.")
      return 0

    file_paths = self.GetFilePaths(complete_run, limit)
    if file_paths is None:
      return 0

    args = ["--test-only", "--limit=%i" % limit, "--error-resilient"] + \
           file_paths

    stdout_text, stderr_text, return_code = self.tools.RunAuditor(
        args, use_python_auditor)

    if stdout_text:
      print(stdout_text)
    if stderr_text:
      print("\n[Runtime Messages]:\n%s" % stderr_text)

    if self.tools.GetCurrentPlatform() == "android":
      # For now, always mark the android bot as green. This acts as a sort of
      # "FYI" mode.
      #
      # TODO(crbug.com/1254719): Once the Android presubmit bot is stable, turn
      # this into a CQ-blocking failure.
      return 0

    return return_code
Passes all given files to traffic_annotation_auditor to be checked for
    possible violations of network traffic annotation rules.

    Args:
      complete_run: bool Flag requesting to run test on all relevant files.
      use_python_auditor: bool If True, test auditor.py instead of
        t_a_auditor.exe.
      limit: int The upper threshold for number of errors and warnings. Use 0
          for unlimited.

    Returns:
      int Exit code of the network traffic annotation auditor.
    
Passes all given files to traffic_annotation_auditor to be checked for
possible violations of network traffic annotation rules.
Passes all given files to traffic_annotation_auditor to be checked for possible violations of network traffic annotation rules .
def CheckFiles(self, complete_run, limit, use_python_auditor):
    if not self.tools.CanRunAuditor(use_python_auditor):
      print("Network traffic annotation presubmit check was not performed. A "
            "compiled build directory and traffic_annotation_auditor binary "
            "are required to do it.")
      return 0
    file_paths = self.GetFilePaths(complete_run, limit)
    if file_paths is None:
      return 0
    args = ["--test-only", "--limit=%i" % limit, "--error-resilient"] + \
           file_paths
    stdout_text, stderr_text, return_code = self.tools.RunAuditor(
        args, use_python_auditor)
    if stdout_text:
      print(stdout_text)
    if stderr_text:
      print("\n[Runtime Messages]:\n%s" % stderr_text)
    if self.tools.GetCurrentPlatform() == "android":
       TODO(crbug.com/1254719): Once the Android presubmit bot is stable, turn
       this into a CQ-blocking failure.
      return 0
    return return_code
def CheckFiles ( self , complete_run , limit , use_python_auditor ) : if not self . tools . CanRunAuditor ( use_python_auditor ) : print ( "Network traffic annotation presubmit check was not performed. A " "compiled build directory and traffic_annotation_auditor binary " "are required to do it." ) return 0 file_paths = self . GetFilePaths ( complete_run , limit ) if file_paths is None : return 0 args = [ "--test-only" , "--limit=%i" % limit , "--error-resilient" ] + file_paths stdout_text , stderr_text , return_code = self . tools . RunAuditor ( args , use_python_auditor ) if stdout_text : print ( stdout_text ) if stderr_text : print ( "\n[Runtime Messages]:\n%s" % stderr_text ) if self . tools . GetCurrentPlatform ( ) == "android" : return 0 return return_code
Passes all given files to traffic_annotation_auditor to be checked for
possible violations of network traffic annotation rules.
Passes all given files to traffic_annotation_auditor to be checked for possible violations of network traffic annotation rules .
"""Passes all given files to traffic_annotation_auditor to be checked for
    possible violations of network traffic annotation rules.

    Args:
      complete_run: bool Flag requesting to run test on all relevant files.
      use_python_auditor: bool If True, test auditor.py instead of
        t_a_auditor.exe.
      limit: int The upper threshold for number of errors and warnings. Use 0
          for unlimited.

    Returns:
      int Exit code of the network traffic annotation auditor.
    """ # For now, always mark the android bot as green. This acts as a sort of # "FYI" mode. # # TODO(crbug.com/1254719): Once the Android presubmit bot is stable, turn # this into a CQ-blocking failure.
int Exit code of the network traffic annotation auditor.
int Exit code of the network traffic annotation auditor .
self
complete_run
bool Flag requesting to run test on all relevant files.
bool Flag requesting to run test on all relevant files .
limit
int The upper threshold for number of errors and warnings. Use 0
for unlimited.
int The upper threshold for number of errors and warnings . Use 0 for unlimited .
use_python_auditor
bool If True, test auditor.py instead of
t_a_auditor.exe.
bool If True test auditor . py instead of t_a_auditor . exe .