diff --git a/.gitignore b/.gitignore
index d52e479..57f3397 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
*.py[cod]
*.egg-info
.DS_Store
+# ignore pycharm config files
+.idea
.cache
build/
dist/
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..5a3031e
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/shopify_python/git_utils.py b/shopify_python/git_utils.py
index ce4b122..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)
@@ -60,6 +59,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 if _file_is_python(item)]
+
+
# Options are defined here: https://pypi.python.org/pypi/autopep8#usage
_AutopepOptions = typing.NamedTuple('_AutopepOptions', [ # pylint: disable=global-variable,invalid-name
('aggressive', int),