# Path: dev_tools/all_checks.py
# ALL_CHECKS = [
#     pylint,
#     typecheck,
#     pytest,
#     incremental_coverage,
# ]
# 
# 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:


import os
import sys
from dev_tools import all_checks, prepared_env, shell_tools
# 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))
        sys.exit(1)
    comparison_branch = sys.argv[1]

    env = prepared_env.PreparedEnv(
        github_repo=None,
        actual_commit_id=None,  # local uncommitted files
        compare_commit_id=comparison_branch,
        destination_directory=os.getcwd(),
        virtual_env_path=None)
    check_results = [
        all_checks.pytest.run(env, False, set()),

# Path: dev_tools/all_checks.py
# ALL_CHECKS = [
#     pylint,
#     typecheck,
#     pytest,
#     incremental_coverage,
# ]
# 
# 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/run_pytest_and_incremental_coverage.py
import os
import sys
from dev_tools import all_checks, prepared_env, shell_tools

# 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))
        sys.exit(1)
    comparison_branch = sys.argv[1]

    env = prepared_env.PreparedEnv(
        github_repo=None,
        actual_commit_id=None,  # local uncommitted files
        compare_commit_id=comparison_branch,
        destination_directory=os.getcwd(),
        virtual_env_path=None)
    check_results = [
        all_checks.pytest.run(env, False, set()),

        all_checks.incremental_coverage.run(env, False, set()),