From 5e8dd81294443e126a2c6941a8fb042e8986a5b8 Mon Sep 17 00:00:00 2001 From: Tamer Sherif Date: Fri, 1 Nov 2019 13:35:28 -0400 Subject: [PATCH 1/4] added additional methods --- .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 +++ .idea/shopify_python.iml | 11 ++++ .idea/vcs.xml | 6 +++ .idea/workspace.xml | 54 +++++++++++++++++++ shopify_python/git_utils.py | 14 +++++ 7 files changed, 103 insertions(+) create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/shopify_python.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a2e120d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..86b4a4f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/shopify_python.iml b/.idea/shopify_python.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/shopify_python.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..3ca303c --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + 1572620505395 + + + + + + + \ No newline at end of file diff --git a/shopify_python/git_utils.py b/shopify_python/git_utils.py index ce4b122..717801e 100644 --- a/shopify_python/git_utils.py +++ b/shopify_python/git_utils.py @@ -60,6 +60,20 @@ def changed_python_files_in_tree(root_path): if os.path.exists(abs_mod) and os.path.isfile(abs_mod) and _file_is_python(abs_mod)] +def uncommitted_python_files(root_path): + # type: (str) -> typing.FrozenSet[str] + git_repo = repo.Repo(root_path) + unstaged_files = [file.a_path for file in git_repo.index.diff(None) if _file_is_python(file.a_path)] + staged_files = [file.a_path for file in git_repo.index.diff('HEAD') if _file_is_python(file.a_path)] + return frozenset(unstaged_files + staged_files) + + +def untracked_python_files(root_path): + # type: (str) -> typing.List[str] + git_repo = repo.Repo(root_path) + return [item for item in git_repo.untracked_files] + + # Options are defined here: https://pypi.python.org/pypi/autopep8#usage _AutopepOptions = typing.NamedTuple('_AutopepOptions', [ # pylint: disable=global-variable,invalid-name ('aggressive', int), From 74767f0d7fd1638622d54b89608972ee28a68cfa Mon Sep 17 00:00:00 2001 From: Tamer Sherif Date: Fri, 1 Nov 2019 13:41:17 -0400 Subject: [PATCH 2/4] deleted files --- .../inspectionProfiles/profiles_settings.xml | 6 --- .idea/misc.xml | 4 -- .idea/modules.xml | 8 --- .idea/vcs.xml | 6 --- .idea/workspace.xml | 54 ------------------- 5 files changed, 78 deletions(-) delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index a2e120d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 86b4a4f..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3ca303c..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - 1572620505395 - - - - - - - \ No newline at end of file From 6cfb6471f3cb466119a1bed12726b5bcb8005380 Mon Sep 17 00:00:00 2001 From: Tamer Sherif Date: Fri, 1 Nov 2019 13:41:57 -0400 Subject: [PATCH 3/4] deleted files --- .idea/shopify_python.iml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .idea/shopify_python.iml diff --git a/.idea/shopify_python.iml b/.idea/shopify_python.iml deleted file mode 100644 index 6711606..0000000 --- a/.idea/shopify_python.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file From 7dcc8372b06053dddf1801c54b3e434cda7ff092 Mon Sep 17 00:00:00 2001 From: Tamer Sherif Date: Fri, 1 Nov 2019 13:57:28 -0400 Subject: [PATCH 4/4] removed spacing --- .idea/inspectionProfiles/Project_Default.xml | 116 +++++++++++++++++++ .idea/workspace.xml | 28 +++++ shopify_python/git_utils.py | 3 +- 3 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6b49f1d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,116 @@ + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..a564352 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shopify_python/git_utils.py b/shopify_python/git_utils.py index 717801e..586df04 100644 --- a/shopify_python/git_utils.py +++ b/shopify_python/git_utils.py @@ -51,7 +51,6 @@ def _file_is_python(path): def changed_python_files_in_tree(root_path): # type: (str) -> typing.List[str] - git_repo = repo.Repo(root_path) remote_master = _remote_origin_master(git_repo) modified = _modified_in_branch(git_repo, remote_master) @@ -71,7 +70,7 @@ def uncommitted_python_files(root_path): def untracked_python_files(root_path): # type: (str) -> typing.List[str] git_repo = repo.Repo(root_path) - return [item for item in git_repo.untracked_files] + return [item for item in git_repo.untracked_files if _file_is_python(item)] # Options are defined here: https://pypi.python.org/pypi/autopep8#usage