# Path: dev_tools/prepared_env.py
# class PreparedEnv:
#     def __init__(self,
#                  github_repo: Optional[github_repository.GithubRepository],
#                  actual_commit_id: Optional[str],
#                  compare_commit_id: str,
#                  destination_directory: Optional[str],
#                  virtual_env_path: Optional[str]) -> None:
#     def bin(self, program: str) -> str:
#     def report_status_to_github(self,
#                                 state: str,
#                                 description: str,
#                                 context: str,
#                                 target_url: Optional[str] = None):
#     def get_changed_files(self) -> List[str]:
# 
# Path: dev_tools/shell_tools.py
# BOLD = 1
# DIM = 2
# RED = 31
# GREEN = 32
# YELLOW = 33
# def highlight(text: str, color_code: int, bold: bool=False) -> str:
#     def __init__(self, out_pipe: Optional[IO[str]] = None) -> None:
# async def _async_forward(async_chunks: collections.AsyncIterable,
#                          out: Optional[Union[TeeCapture, IO[str]]]
#                          ) -> Optional[str]:
# async def _async_wait_for_process(
#         future_process: Any,
#         out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#         err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr
# ) -> CommandOutput:
# def abbreviate_command_arguments_after_switches(
#         cmd: Tuple[str, ...]) -> Tuple[str, ...]:
# def run_cmd(*cmd: Optional[str],
#             out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#             err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#             raise_on_fail: bool = True,
#             log_run_to_stderr: bool = True,
#             abbreviate_non_option_arguments: bool = False,
#             **kwargs
#             ) -> CommandOutput:
# def run_shell(cmd: str,
#               out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#               err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#               raise_on_fail: bool = True,
#               log_run_to_stderr: bool = True,
#               **kwargs
#               ) -> CommandOutput:
# def output_of(*cmd: Optional[str], **kwargs) -> str:
# class TeeCapture:
# 
# Path: dev_tools/incremental_coverage.py
# def check_for_uncovered_lines(env: env_tools.PreparedEnv) -> int:
#     # Build context from environment.
#     changed_files = env.get_changed_files()
# 
#     # Find/print lines that were changed but aren't covered.
#     uncovered_count = 0
#     for changed_file in changed_files:
#         if not is_applicable_python_file(changed_file):
#             continue
# 
#         base_path = cast(str, env.destination_directory)
#         uncovered_lines = get_incremental_uncovered_lines(
#             os.path.join(base_path, changed_file),
#             env.compare_commit_id,
#             env.actual_commit_id)
# 
#         if uncovered_lines:
#             uncovered_count += len(uncovered_lines)
#             print(shell_tools.highlight(
#                 '************* {} ({} uncovered)'.format(
#                     changed_file,
#                     len(uncovered_lines)),
#                 color_code=shell_tools.RED))
#         for index, line, reason in uncovered_lines:
#             print('Line {} {} but not covered: {}'.format(
#                 shell_tools.highlight(str(index).rjust(4),
#                                       color_code=shell_tools.BOLD),
#                 reason,
#                 shell_tools.highlight(line,
#                                       color_code=shell_tools.YELLOW)))
# 
#     # Inform of aggregate result.
#     print()
#     if uncovered_count:
#         print(shell_tools.highlight(
#             'Found {} uncovered touched lines.'.format(uncovered_count),
#             color_code=shell_tools.RED))
#     else:
#         print(shell_tools.highlight('All touched lines covered',
#                                     color_code=shell_tools.GREEN))
#     print()
#     return uncovered_count


import os
import sys
from dev_tools import prepared_env, shell_tools
from dev_tools.incremental_coverage import check_for_uncovered_lines
#!/usr/bin/env python

# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.





def main():
    if len(sys.argv) < 2:
        print(
            shell_tools.highlight(
                'Must specify a comparison branch '

# Path: dev_tools/prepared_env.py
# class PreparedEnv:
#     def __init__(self,
#                  github_repo: Optional[github_repository.GithubRepository],
#                  actual_commit_id: Optional[str],
#                  compare_commit_id: str,
#                  destination_directory: Optional[str],
#                  virtual_env_path: Optional[str]) -> None:
#     def bin(self, program: str) -> str:
#     def report_status_to_github(self,
#                                 state: str,
#                                 description: str,
#                                 context: str,
#                                 target_url: Optional[str] = None):
#     def get_changed_files(self) -> List[str]:
# 
# Path: dev_tools/shell_tools.py
# BOLD = 1
# DIM = 2
# RED = 31
# GREEN = 32
# YELLOW = 33
# def highlight(text: str, color_code: int, bold: bool=False) -> str:
#     def __init__(self, out_pipe: Optional[IO[str]] = None) -> None:
# async def _async_forward(async_chunks: collections.AsyncIterable,
#                          out: Optional[Union[TeeCapture, IO[str]]]
#                          ) -> Optional[str]:
# async def _async_wait_for_process(
#         future_process: Any,
#         out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#         err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr
# ) -> CommandOutput:
# def abbreviate_command_arguments_after_switches(
#         cmd: Tuple[str, ...]) -> Tuple[str, ...]:
# def run_cmd(*cmd: Optional[str],
#             out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#             err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#             raise_on_fail: bool = True,
#             log_run_to_stderr: bool = True,
#             abbreviate_non_option_arguments: bool = False,
#             **kwargs
#             ) -> CommandOutput:
# def run_shell(cmd: str,
#               out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
#               err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr,
#               raise_on_fail: bool = True,
#               log_run_to_stderr: bool = True,
#               **kwargs
#               ) -> CommandOutput:
# def output_of(*cmd: Optional[str], **kwargs) -> str:
# class TeeCapture:
# 
# Path: dev_tools/incremental_coverage.py
# def check_for_uncovered_lines(env: env_tools.PreparedEnv) -> int:
#     # Build context from environment.
#     changed_files = env.get_changed_files()
# 
#     # Find/print lines that were changed but aren't covered.
#     uncovered_count = 0
#     for changed_file in changed_files:
#         if not is_applicable_python_file(changed_file):
#             continue
# 
#         base_path = cast(str, env.destination_directory)
#         uncovered_lines = get_incremental_uncovered_lines(
#             os.path.join(base_path, changed_file),
#             env.compare_commit_id,
#             env.actual_commit_id)
# 
#         if uncovered_lines:
#             uncovered_count += len(uncovered_lines)
#             print(shell_tools.highlight(
#                 '************* {} ({} uncovered)'.format(
#                     changed_file,
#                     len(uncovered_lines)),
#                 color_code=shell_tools.RED))
#         for index, line, reason in uncovered_lines:
#             print('Line {} {} but not covered: {}'.format(
#                 shell_tools.highlight(str(index).rjust(4),
#                                       color_code=shell_tools.BOLD),
#                 reason,
#                 shell_tools.highlight(line,
#                                       color_code=shell_tools.YELLOW)))
# 
#     # Inform of aggregate result.
#     print()
#     if uncovered_count:
#         print(shell_tools.highlight(
#             'Found {} uncovered touched lines.'.format(uncovered_count),
#             color_code=shell_tools.RED))
#     else:
#         print(shell_tools.highlight('All touched lines covered',
#                                     color_code=shell_tools.GREEN))
#     print()
#     return uncovered_count


# Path: dev_tools/check_incremental_coverage_annotations.py
import os
import sys
from dev_tools import prepared_env, shell_tools
from dev_tools.incremental_coverage import check_for_uncovered_lines

#!/usr/bin/env python

# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.





def main():
    if len(sys.argv) < 2:
        print(
            shell_tools.highlight(
                'Must specify a comparison branch '

                '(e.g. "origin/master" or "HEAD~1").', shell_tools.RED))