diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6a0ee6a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +[*] +max_line_length=120 diff --git a/.gitignore b/.gitignore index 80d298e..df0a1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -165,7 +165,9 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -.idea/ +.idea +/VersionTwo.iml +*/**/*.iml # Ruff stuff: .ruff_cache/ @@ -173,9 +175,7 @@ cython_debug/ # PyPI configuration file .pypirc - **/**.DS_Store _site/* !_site/.gitkeep - diff --git a/src/version_two_config.py b/src/version_two_config.py new file mode 100644 index 0000000..b4b2732 --- /dev/null +++ b/src/version_two_config.py @@ -0,0 +1,114 @@ +import argparse + + +class VersionTwoConfig: + def __init__(self): + parser = argparse.ArgumentParser( + prog='VersionTwo', + description="Render an HTML page from a collection of GitHub Issues and Pull Requests" + ) + + parser.add_argument( + "--include-user", + dest="include_user", + action="append", + type=str, + nargs="+", + help="Include all issues and PRs for the provided user [Required Parameter]",) + + parser.add_argument( + "--include-repository", + dest="include_repository", + action="append", + type=str, + nargs="+", + help="Include all issues and PRs from the specified repository",) + + parser.add_argument( + "--include-organization-repository", + dest="include_organization_repository", + action="append", + type=str, + nargs="+", + help="Include all issues and PRs from the specified organization/repository",) + + parser.add_argument( + "--include-label", + dest="include_label", + action="append", + type=str, + nargs="+", + help="Include all issues and PRs with the specified label",) + + parser.add_argument( + "--exclude-organization", + dest="exclude_organization", + action="append", + type=str, + nargs="+", + help="Exclude all issues and PRs from the specified organization",) + + parser.add_argument( + "--exclude-repository", + dest="exclude_repository", + action="append", + type=str, + nargs="+", + help="Exclude all issues and PRs from the specified repository",) + + parser.add_argument( + "--exclude-organization-repository", + dest="exclude_organization_repository", + action="append", + type=str, + nargs="+", + help="Exclude all issues and PRs from the specified " + "organization/repository",) + + parser.add_argument( + "--exclude-user", + dest="exclude_user", + action="append", + type=str, + nargs="+", + help="Exclude all issues and PRs for the provided user",) + + parser.add_argument( + "--exclude-label", + dest="exclude_label", + action="append", + type=str, + nargs="+", + help="Exclude all issues and PRs with the specified label",) + + parser.add_argument( + "--publish-board", + dest="publish_board", + action="store_const", + help="The organization/board to publish (add) the collection of GitHub Issues and Pull Requests",) + + parsed_args = parser.parse_args() + + self.include_user = parsed_args.include_user + self.include_repository = parsed_args.include_repository + self.include_organization_repository = parsed_args.include_organization_repository + self.include_label = parsed_args.include_label + self.exclude_organization = parsed_args.exclude_organization + self.exclude_repository = parsed_args.exclude_repository + self.exclude_organization_repository = parsed_args.exclude_organization_repository + self.exclude_user = parsed_args.exclude_user + self.exclude_label = parsed_args.exclude_label + self.publish_board = parsed_args.publish_board + + def display_config(self): + print("Configuration:") + print(f"Include User: {self.include_user}") + print(f"Include Repository: {self.include_repository}") + print(f"Include Organization/Repository: {self.include_organization_repository}") + print(f"Include Label: {self.include_label}") + print(f"Exclude Organization: {self.exclude_organization}") + print(f"Exclude Repository: {self.exclude_repository}") + print(f"Exclude Organization/Repository: {self.exclude_organization_repository}") + print(f"Exclude User: {self.exclude_user}") + print(f"Exclude Label: {self.exclude_label}") + print(f"Publish Board: {self.publish_board}") diff --git a/version_two.py b/version_two.py new file mode 100644 index 0000000..1269f40 --- /dev/null +++ b/version_two.py @@ -0,0 +1,10 @@ +from src.version_two_config import VersionTwoConfig + + +def main(): + config = VersionTwoConfig() + config.display_config() + + +if __name__ == "__main__": + main()