def latex_template_files_exist(self) -> None: """ Checks a given project directory for required files. Iterates through the templates's directory content and checkmarks files for presence. Files that **must** be present:: 'Dockerfile', 'Makefile', 'thesis.tex', 'thesis-info.tex', 'cookietemple.cfg', '.cookietemple.yml' Files that *should* be present:: 'References/references.bib', 'Variables.ini', 'glyphtounicode.tex', Files that *must not* be present:: none Files that *should not* be present:: '.travis.yml' """ # NB: Should all be files, not directories # List of lists. Passes if any of the files in the sublist are found. files_fail = [ ['Dockerfile'], ['Makefile'], ['thesis.tex'], ['thesis-info.tex'], ['cookietemple.cfg'], ['.cookietemple.yml'], ] files_warn = [ [os.path.join('References', 'references.bib')], ['Variables.ini'], ['glyphtounicode.tex'], ] # List of strings. Fails / warns if any of the strings exist. files_fail_ifexists: List[str] = [] files_warn_ifexists = ['.travis.yml'] files_exist_linting(self, files_fail, files_fail_ifexists, files_warn, files_warn_ifexists, handle='pub-thesis-latex')
def java_files_exist(self) -> None: """ Checks a given project directory for required files. Iterates through the templates's directory content and checkmarks files for presence. Files that **must** be present:: 'build.gradle', 'settings.gradle', Files that *should* be present:: '.github/workflows/build_deploy.yml', '.github/workflows/run_checkstyle.yml', '.github/workflows/tox_tests.yml', 'gradle/wrapper/gradle-wrapper.jar', 'gradle/wrapper/gradle-wrapper.properties', 'gradlew', 'gradlew.bat', Files that *must not* be present:: none Files that *should not* be present:: none """ # NB: Should all be files, not directories # List of lists. Passes if any of the files in the sublist are found. files_fail = [ ['build.gradle'], ['settings.gradle'], ] files_warn = [ [os.path.join('.github', 'workflows', 'build_deploy.yml')], [os.path.join('.github', 'workflows', 'run_checkstyle.yml')], [os.path.join('.github', 'workflows', 'run_tests.yml')], [os.path.join('gradle', 'wrapper', 'gradle-wrapper.jar')], [os.path.join('gradle', 'wrapper', 'gradle-wrapper.properties')], [os.path.join('gradlew')], [os.path.join('gradlew.bat')], ] # List of strings. Fails / warns if any of the strings exist. files_fail_ifexists: List[str] = [] files_warn_ifexists: List[str] = [] files_exist_linting(self, files_fail, files_fail_ifexists, files_warn, files_warn_ifexists, handle='cli-java')
def python_files_exist(self) -> None: """ Checks a given project directory for required files. Iterates through the templates's directory content and checkmarks files for presence. Files that **must** be present:: 'setup.py', 'setup.cfg', 'MANIFEST.in', 'tox.ini', Files that *should* be present:: '.github/workflows/build_package.yml', '.github/workflows/publish_package.yml', '.github/workflows/tox_testsuite.yml', '.github/workflows/flake8.yml', Files that *must not* be present:: none Files that *should not* be present:: '__pycache__' """ # NB: Should all be files, not directories # List of lists. Passes if any of the files in the sublist are found. files_fail = [ ['setup.py'], ['setup.cfg'], ['MANIFEST.in'], ['tox.ini'], ] files_warn = [ [os.path.join('.github', 'workflows', 'build_package.yml')], [os.path.join('.github', 'workflows', 'publish_package.yml')], [os.path.join('.github', 'workflows', 'run_tox_testsuite.yml')], [os.path.join('.github', 'workflows', 'run_flake8_linting.yml')], ] # List of strings. Fails / warns if any of the strings exist. files_fail_ifexists = ['__pycache__'] files_warn_ifexists: List[str] = [] files_exist_linting(self, files_fail, files_fail_ifexists, files_warn, files_warn_ifexists, handle='cli-python')
def cpp_files_exist(self) -> None: """ Checks a given project directory for required files. Iterates through the templates's directory content and checkmarks files for presence. Files that **must** be present:: 'CMakeLists.txt', Files that *should* be present:: '.clang-format' '.clang-tidy' '.github/workflows/build_windows.yml', '.github/workflows/build_linux.yml', '.github/workflows/build_macos.yml', '.github/workflows/release.yml', Files that *must not* be present:: none Files that *should not* be present:: none """ # NB: Should all be files, not directories # List of lists. Passes if any of the files in the sublist are found. files_fail = [ ["CMakeLists.txt"], ] files_warn = [ [os.path.join(".clang-format")], [os.path.join(".clang-tidy")], [os.path.join(".github", "workflows", "build_windows.yml")], [os.path.join(".github", "workflows", "build_linux.yml")], [os.path.join(".github", "workflows", "build_macos.yml")], [os.path.join(".github", "workflows", "release.yml")], ] # List of strings. Fails / warns if any of the strings exist. files_fail_ifexists: List[str] = [] files_warn_ifexists: List[str] = [] files_exist_linting(self, files_fail, files_fail_ifexists, files_warn, files_warn_ifexists, handle="lib-cpp")
def java_files_exist(self) -> None: """ Checks a given project directory for required files. Iterates through the templates's directory content and checkmarks files for presence. Files that **must** be present:: 'pom.xml', Files that *should* be present:: '.github/workflows/build_package.yml', '.github/workflows/build_docs.yml', '.github/workflows/run_tests.yml', '.github/workflows/java_linting.yml', Files that *must not* be present:: none Files that *should not* be present:: none """ # NB: Should all be files, not directories # List of lists. Passes if any of the files in the sublist are found. files_fail = [ ['pom.xml'], ] files_warn = [ [os.path.join('.github', 'workflows', 'build_docs.yml')], [os.path.join('.github', 'workflows', 'run_tests.yml')], [os.path.join('.github', 'workflows', 'run_java_linting.yml')], ] # List of strings. Fails / warns if any of the strings exist. files_fail_ifexists: List[str] = [] files_warn_ifexists: List[str] = [] files_exist_linting(self, files_fail, files_fail_ifexists, files_warn, files_warn_ifexists, handle='gui-java')
def python_files_exist(self) -> None: """ Checks a given project directory for required files. Iterates through the templates's directory content and checkmarks files for presence. Files that **must** be present:: 'poetry.lock', 'pyproject.toml', 'noxfile.py', Files that *should* be present:: '.github/workflows/build_package.yml', '.github/workflows/publish_package.yml', '.github/workflows/test.yml', Files that *must not* be present:: none Files that *should not* be present:: '__pycache__' """ # NB: Should all be files, not directories # List of lists. Passes if any of the files in the sublist are found. files_fail = [ ["poetry.lock"], ["pyproject.toml"], ["noxfile.py"], ] files_warn = [ [os.path.join(".github", "workflows", "build_package.yml")], [os.path.join(".github", "workflows", "publish_package.yml")], [os.path.join(".github", "workflows", "run_tests.yml")], ] # List of strings. Fails / warns if any of the strings exist. files_fail_ifexists = ["__pycache__"] files_warn_ifexists: List[str] = [] files_exist_linting(self, files_fail, files_fail_ifexists, files_warn, files_warn_ifexists, handle="cli-python")