diff --git a/approval_utilities/utils.py b/approval_utilities/utils.py index ca7e646..25d9521 100644 --- a/approval_utilities/utils.py +++ b/approval_utilities/utils.py @@ -58,10 +58,13 @@ def is_windows_os() -> bool: def create_empty_file(file_path: str) -> None: try: import empty_files.empty_files + empty_files.empty_files.create_empty_file(file_path) except ImportError as e: print("Error importing empty_files", e) raise + + def ensure_file_exists(approved_path: str) -> None: print("approved_path check", approved_path) if not os.path.isfile(approved_path): @@ -82,7 +85,10 @@ def print_grid(width, height, cell_print_func): result += "\n" return result + _V = TypeVar("_V") _K = TypeVar("_K") -def filter_values(filter: Callable[[_V],bool], a_dict: Dict[_K,_V]) -> Dict[_K,_V]: - return {k: v for k, v in a_dict.items() if filter(v)} \ No newline at end of file + + +def filter_values(filter: Callable[[_V], bool], a_dict: Dict[_K, _V]) -> Dict[_K, _V]: + return {k: v for k, v in a_dict.items() if filter(v)} diff --git a/approvaltests/reporters/generic_diff_reporter.py b/approvaltests/reporters/generic_diff_reporter.py index 94cc108..d682704 100644 --- a/approvaltests/reporters/generic_diff_reporter.py +++ b/approvaltests/reporters/generic_diff_reporter.py @@ -33,11 +33,10 @@ def __init__(self, config: GenericDiffReporterConfig) -> None: self.extra_args = config.extra_args def __str__(self) -> str: - config = filter_values(lambda v: bool(v), { - "name": self.name, - "path": self.path, - "arguments": self.extra_args - }) + config = filter_values( + lambda v: bool(v), + {"name": self.name, "path": self.path, "arguments": self.extra_args}, + ) return to_json(config) @staticmethod diff --git a/approvaltests/reporters/report_with_beyond_compare.py b/approvaltests/reporters/report_with_beyond_compare.py index eb342be..ee6a484 100644 --- a/approvaltests/reporters/report_with_beyond_compare.py +++ b/approvaltests/reporters/report_with_beyond_compare.py @@ -20,7 +20,8 @@ class ReportWithBeyondCompareMac(GenericDiffReporter): def __init__(self): super().__init__( config=GenericDiffReporterConfig( - name=self.__class__.__name__, path='/Applications/Beyond Compare.app/Contents/MacOS/BCompare' + name=self.__class__.__name__, + path="/Applications/Beyond Compare.app/Contents/MacOS/BCompare", ) ) diff --git a/docs/Contribute.md b/docs/Contribute.md index 44c3479..7d42e6f 100644 --- a/docs/Contribute.md +++ b/docs/Contribute.md @@ -8,6 +8,7 @@ * [Zoom Link](#zoom-link) * [Requirements](#requirements) * [Opening Notice](#opening-notice) + * [Startup Checklist](#startup-checklist) * [Anydesk](#anydesk) * [Solo Developement](#solo-developement) diff --git a/mob-sessions-retros/2024-09-15-retro.md b/mob-sessions-retros/2024-09-15-retro.md index e275381..ffc50e0 100644 --- a/mob-sessions-retros/2024-09-15-retro.md +++ b/mob-sessions-retros/2024-09-15-retro.md @@ -18,4 +18,4 @@ What should we change next time? - Never launched mobtimer. - Startup checklist: - Run all the tests - - Start the mobtimer \ No newline at end of file + - Start the mobtimer diff --git a/tests/test_build.py b/tests/test_build.py index 25748ad..a68da15 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -1,21 +1,21 @@ import os import ast + def test_no_imports_from_build_directory(): # Make sure no file imports from build - root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) for dirpath, dirnames, filenames in os.walk(root_dir): # Exclude directories that start with '.' - dirnames[:] = [d for d in dirnames if not d.startswith('.') and d != 'build'] + dirnames[:] = [d for d in dirnames if not d.startswith(".") and d != "build"] # also exclude venv - dirnames[:] = [d for d in dirnames if not d.startswith('venv' - )] + dirnames[:] = [d for d in dirnames if not d.startswith("venv")] for filename in filenames: # Skip files that start with '.' and non-Python files - if filename.startswith('.') or not filename.endswith('.py'): + if filename.startswith(".") or not filename.endswith(".py"): continue file_path = os.path.join(dirpath, filename) - with open(file_path, 'r', encoding='utf-8') as file: + with open(file_path, "r", encoding="utf-8") as file: source = file.read() try: tree = ast.parse(source, filename=file_path) @@ -24,8 +24,10 @@ def test_no_imports_from_build_directory(): for node in ast.walk(tree): if isinstance(node, ast.Import): for alias in node.names: - if alias.name == 'build' or alias.name.startswith('build.'): + if alias.name == "build" or alias.name.startswith("build."): assert False, f"{file_path} imports 'build'" elif isinstance(node, ast.ImportFrom): - if node.module == 'build' or (node.module and node.module.startswith('build.')): + if node.module == "build" or ( + node.module and node.module.startswith("build.") + ): assert False, f"{file_path} imports from 'build'"