git-format-staged 3.1.0 → 3.1.1
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.
- package/git-format-staged +5 -5
- package/package.json +1 -1
package/git-format-staged
CHANGED
|
@@ -22,8 +22,8 @@ import re
|
|
|
22
22
|
import subprocess
|
|
23
23
|
import sys
|
|
24
24
|
|
|
25
|
-
# The string 3.1.
|
|
26
|
-
VERSION = '3.1.
|
|
25
|
+
# The string 3.1.1 is replaced during the publish process.
|
|
26
|
+
VERSION = '3.1.1'
|
|
27
27
|
PROG = sys.argv[0]
|
|
28
28
|
|
|
29
29
|
def info(msg):
|
|
@@ -86,7 +86,7 @@ def format_file_in_index(formatter, diff_entry, update_working_tree=True, write=
|
|
|
86
86
|
|
|
87
87
|
return new_hash
|
|
88
88
|
|
|
89
|
-
file_path_placeholder = re.compile('\{\}')
|
|
89
|
+
file_path_placeholder = re.compile(r'\{\}')
|
|
90
90
|
|
|
91
91
|
# Run formatter on a git blob identified by its hash. Writes output to a new git
|
|
92
92
|
# blob, and returns the hash of the new blob.
|
|
@@ -167,7 +167,7 @@ def patch_working_file(path, orig_object_hash, new_object_hash):
|
|
|
167
167
|
raise Exception('could not apply formatting changes to working tree file {}'.format(path))
|
|
168
168
|
|
|
169
169
|
# Format: src_mode dst_mode src_hash dst_hash status/score? src_path dst_path?
|
|
170
|
-
diff_pat = re.compile('^:(\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([A-Z])(\d+)?\t([^\t]+)(?:\t([^\t]+))?$')
|
|
170
|
+
diff_pat = re.compile(r'^:(\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([A-Z])(\d+)?\t([^\t]+)(?:\t([^\t]+))?$')
|
|
171
171
|
|
|
172
172
|
# Parse output from `git diff-index`
|
|
173
173
|
def parse_diff(diff):
|
|
@@ -185,7 +185,7 @@ def parse_diff(diff):
|
|
|
185
185
|
'dst_path': m.group(8)
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
zeroed_pat = re.compile('^0+$')
|
|
188
|
+
zeroed_pat = re.compile(r'^0+$')
|
|
189
189
|
|
|
190
190
|
# Returns the argument unless the argument is a string of zeroes, in which case
|
|
191
191
|
# returns `None`
|
package/package.json
CHANGED