runem 0.0.30__py3-none-any.whl → 0.0.31__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
runem/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.30
1
+ 0.0.31
runem/command_line.py CHANGED
@@ -119,8 +119,8 @@ def parse_args(
119
119
 
120
120
  parser.add_argument(
121
121
  "-f",
122
- "--modified-files-only",
123
- dest="check_modified_files_only",
122
+ "--modified-files",
123
+ dest="check_modified_files",
124
124
  help="only use files that have changed",
125
125
  action=argparse.BooleanOptionalAction,
126
126
  default=False,
@@ -129,8 +129,8 @@ def parse_args(
129
129
 
130
130
  parser.add_argument(
131
131
  "-h",
132
- "--git-head-files-only",
133
- dest="check_head_files_only",
132
+ "--git-head-files",
133
+ dest="check_head_files",
134
134
  help="fast run of files",
135
135
  action=argparse.BooleanOptionalAction,
136
136
  default=False,
runem/files.py CHANGED
@@ -26,26 +26,44 @@ def find_files(config_metadata: ConfigMetadata) -> FilePathListLookup:
26
26
 
27
27
  file_paths: typing.List[str] = []
28
28
 
29
- if config_metadata.args.check_modified_files_only:
30
- file_paths = (
31
- subprocess_check_output(
32
- "git diff --name-only",
33
- shell=True,
29
+ if (
30
+ config_metadata.args.check_modified_files
31
+ or config_metadata.args.check_head_files
32
+ ):
33
+ if config_metadata.args.check_modified_files:
34
+ # get modified, un-staged files first
35
+ file_paths.extend(
36
+ subprocess_check_output(
37
+ "git diff --name-only",
38
+ shell=True,
39
+ )
40
+ .decode("utf-8")
41
+ .splitlines()
34
42
  )
35
- .decode("utf-8")
36
- .splitlines()
37
- )
38
- elif config_metadata.args.check_head_files_only:
39
- # Fetching modified and added files from the HEAD commit that are still on disk
40
- file_paths = (
41
- subprocess_check_output(
42
- "git diff-tree --no-commit-id --name-only -r HEAD",
43
- shell=True,
43
+ # now get modified, staged files first
44
+ file_paths.extend(
45
+ subprocess_check_output(
46
+ "git diff --name-only --staged",
47
+ shell=True,
48
+ )
49
+ .decode("utf-8")
50
+ .splitlines()
44
51
  )
45
- .decode("utf-8")
46
- .splitlines()
52
+
53
+ if config_metadata.args.check_head_files:
54
+ # Fetching modified and added files from the HEAD commit
55
+ file_paths.extend(
56
+ subprocess_check_output(
57
+ "git diff-tree --no-commit-id --name-only -r HEAD",
58
+ shell=True,
59
+ )
60
+ .decode("utf-8")
61
+ .splitlines()
62
+ )
63
+ # ensure files are unique, and still on disk i.e. filter-out deleted files
64
+ file_paths = list(
65
+ {file_path for file_path in file_paths if Path(file_path).exists()}
47
66
  )
48
- file_paths = [file_path for file_path in file_paths if Path(file_path).exists()]
49
67
  else:
50
68
  # fall-back to all files
51
69
  file_paths = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: runem
3
- Version: 0.0.30
3
+ Version: 0.0.31
4
4
  Summary: Awesome runem created by lursight
5
5
  Home-page: https://github.com/lursight/runem/
6
6
  Author: lursight
@@ -1,14 +1,14 @@
1
- runem/VERSION,sha256=gEtWWt0L1z5lxa4WmXDkvO_ucp0v_0QZPdvkbSU-bNs,7
1
+ runem/VERSION,sha256=ygwViIed-jHcHrW47R-z5Om5lbqAJc3R4PPjymEoZCc,7
2
2
  runem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  runem/__main__.py,sha256=dsOiVZegpfK9JOs5n7UmbX5iwwbj7iFkEbLoVeEgAn4,136
4
4
  runem/base.py,sha256=EZfR7FIlwEdU9Vfe47Wk2DOO8GQqpKxxLNKp6YHueZ4,316
5
5
  runem/blocking_print.py,sha256=S9dtgAeuTzc2-ht-vk9Wl6l-0PwS2tYbHDHDQQitrlA,841
6
6
  runem/cli.py,sha256=wEt_Jnumhl8SiOdKdSJzLkJpWv6n3_Odhi_HeIixr1k,134
7
- runem/command_line.py,sha256=1H1wZDfJrNCRly5yUBodYDvvKw8-4uLd3q-tcCvk1jM,11019
7
+ runem/command_line.py,sha256=k8yOlwfWliiJX3m33tkVzuGVQ2i-tuAgOENMWmP2u7Y,10999
8
8
  runem/config.py,sha256=y-e6j84FDiLSKKw9ShDzRlnS5t2e81MW8fKSKtxtJtg,5935
9
9
  runem/config_metadata.py,sha256=Vy7dx8F-Z5jEp16OP2y6vHHoGkyhoCaTG4KIVkMWR7M,3232
10
10
  runem/config_parse.py,sha256=6mCamzWu7HTotmqFJmLZg9FFE6qe1-rpmo8_v5ESPW8,13401
11
- runem/files.py,sha256=CrwEiwPV0ZrrU3Ve0RWTTw9AtOQLekNXua347YYqcqQ,2748
11
+ runem/files.py,sha256=KEL4cdHRJrdK6I_jdy2wGZv5abPvgBPS1aAlmxKxPgc,3377
12
12
  runem/hook_manager.py,sha256=9T-4omyjBPZ6ua_37UWpT1dwNMbb4SKwvxYcN6fVxLE,4163
13
13
  runem/informative_dict.py,sha256=U7p9z78UwOT4TAfng1iDXCEyeYz6C-XZlx9Z1pWNVrI,1548
14
14
  runem/job.py,sha256=QVXvzz67fJk__-h0womFQsB80-w41E3XRcHpxmRnv3o,2912
@@ -25,9 +25,9 @@ runem/runem.py,sha256=RIKF-l_ziGs0oKEueVkfygmnc_xiIdQo2qNDpiA-2Zs,13013
25
25
  runem/runem_version.py,sha256=MbETwZO2Tb1Y3hX_OYZjKepEMKA1cjNvr-7Cqhz6e3s,271
26
26
  runem/types.py,sha256=TLagRdB6-4gKqETAeJzo7-HFwBqQWGTwHcw2slSKN0U,7445
27
27
  runem/utils.py,sha256=3N_kel9LsriiMq7kOjT14XhfxUOgz4hdDg97wlLKm3U,221
28
- runem-0.0.30.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
29
- runem-0.0.30.dist-info/METADATA,sha256=HVftDpbRdnyeVk3Xi1c3VtWIcyVJH_2CUCkJy4qoKFs,29789
30
- runem-0.0.30.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
31
- runem-0.0.30.dist-info/entry_points.txt,sha256=nu0g_vBeuPihYtimbtlNusxWovylMppvJ8UxdJlJfvM,46
32
- runem-0.0.30.dist-info/top_level.txt,sha256=gK6iqh9OfHDDpErioCC9ul_zx2Q5zWTALtcuGU7Vil4,6
33
- runem-0.0.30.dist-info/RECORD,,
28
+ runem-0.0.31.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
29
+ runem-0.0.31.dist-info/METADATA,sha256=PtDmfylhA038JOFt9wKtxrzYjAXhnRGukpxj-BSfxsQ,29789
30
+ runem-0.0.31.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
31
+ runem-0.0.31.dist-info/entry_points.txt,sha256=nu0g_vBeuPihYtimbtlNusxWovylMppvJ8UxdJlJfvM,46
32
+ runem-0.0.31.dist-info/top_level.txt,sha256=gK6iqh9OfHDDpErioCC9ul_zx2Q5zWTALtcuGU7Vil4,6
33
+ runem-0.0.31.dist-info/RECORD,,
File without changes