Skip to content

Commit 8626e26

Browse files
committed
double-quote-string-fixer
1 parent 4575652 commit 8626e26

File tree

8 files changed

+27
-26
lines changed

8 files changed

+27
-26
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repos:
1010
- id: check-yaml
1111
- id: debug-statements
1212
- id: name-tests-test
13+
- id: double-quote-string-fixer
1314
- id: requirements-txt-fixer
1415
- repo: https://gitlab.com/pycqa/flake8
1516
rev: 3.7.1

pre_commit_hooks/fix_encoding_pragma.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,5 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
147147
return retv
148148

149149

150-
if __name__ == "__main__":
150+
if __name__ == '__main__':
151151
exit(main())

pre_commit_hooks/sort_simple_yaml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
115115
new_lines = sort(lines)
116116

117117
if lines != new_lines:
118-
print("Fixing file `{filename}`".format(filename=filename))
118+
print('Fixing file `{filename}`'.format(filename=filename))
119119
f.seek(0)
120-
f.write("\n".join(new_lines) + "\n")
120+
f.write('\n'.join(new_lines) + '\n')
121121
f.truncate()
122122
retval = 1
123123

pre_commit_hooks/trailing_whitespace_fixer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
6969
for ext in md_exts:
7070
if any(c in ext[1:] for c in r'./\:'):
7171
parser.error(
72-
"bad --markdown-linebreak-ext extension {!r} (has . / \\ :)\n"
72+
'bad --markdown-linebreak-ext extension {!r} (has . / \\ :)\n'
7373
" (probably filename; use '--markdown-linebreak-ext=EXT')"
7474
.format(ext),
7575
)

tests/check_builtin_literals_test.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,36 @@ def visitor():
4747
# see #285
4848
('x[0]()', []),
4949
# complex
50-
("0j", []),
51-
("complex()", [Call('complex', 1, 0)]),
52-
("complex(0, 0)", []),
50+
('0j', []),
51+
('complex()', [Call('complex', 1, 0)]),
52+
('complex(0, 0)', []),
5353
("complex('0+0j')", []),
5454
('builtins.complex()', []),
5555
# float
56-
("0.0", []),
57-
("float()", [Call('float', 1, 0)]),
56+
('0.0', []),
57+
('float()', [Call('float', 1, 0)]),
5858
("float('0.0')", []),
5959
('builtins.float()', []),
6060
# int
61-
("0", []),
62-
("int()", [Call('int', 1, 0)]),
61+
('0', []),
62+
('int()', [Call('int', 1, 0)]),
6363
("int('0')", []),
6464
('builtins.int()', []),
6565
# list
66-
("[]", []),
67-
("list()", [Call('list', 1, 0)]),
66+
('[]', []),
67+
('list()', [Call('list', 1, 0)]),
6868
("list('abc')", []),
6969
("list([c for c in 'abc'])", []),
7070
("list(c for c in 'abc')", []),
7171
('builtins.list()', []),
7272
# str
7373
("''", []),
74-
("str()", [Call('str', 1, 0)]),
74+
('str()', [Call('str', 1, 0)]),
7575
("str('0')", []),
7676
('builtins.str()', []),
7777
# tuple
78-
("()", []),
79-
("tuple()", [Call('tuple', 1, 0)]),
78+
('()', []),
79+
('tuple()', [Call('tuple', 1, 0)]),
8080
("tuple('abc')", []),
8181
("tuple([c for c in 'abc'])", []),
8282
("tuple(c for c in 'abc')", []),
@@ -91,9 +91,9 @@ def test_non_dict_exprs(visitor, expression, calls):
9191
@pytest.mark.parametrize(
9292
('expression', 'calls'),
9393
[
94-
("{}", []),
95-
("dict()", [Call('dict', 1, 0)]),
96-
("dict(a=1, b=2, c=3)", []),
94+
('{}', []),
95+
('dict()', [Call('dict', 1, 0)]),
96+
('dict(a=1, b=2, c=3)', []),
9797
("dict(**{'a': 1, 'b': 2, 'c': 3})", []),
9898
("dict([(k, v) for k, v in [('a', 1), ('b', 2), ('c', 3)]])", []),
9999
("dict((k, v) for k, v in [('a', 1), ('b', 2), ('c', 3)])", []),
@@ -108,8 +108,8 @@ def test_dict_allow_kwargs_exprs(visitor, expression, calls):
108108
@pytest.mark.parametrize(
109109
('expression', 'calls'),
110110
[
111-
("dict()", [Call('dict', 1, 0)]),
112-
("dict(a=1, b=2, c=3)", [Call('dict', 1, 0)]),
111+
('dict()', [Call('dict', 1, 0)]),
112+
('dict(a=1, b=2, c=3)', [Call('dict', 1, 0)]),
113113
("dict(**{'a': 1, 'b': 2, 'c': 3})", [Call('dict', 1, 0)]),
114114
('builtins.dict()', []),
115115
],

tests/detect_aws_credentials_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_non_existent_credentials(mock_secrets_env, mock_secrets_file, capsys):
123123
mock_secrets_file.return_value = set()
124124
ret = main((
125125
get_resource_path('aws_config_without_secrets.ini'),
126-
"--credentials-file=testing/resources/credentailsfilethatdoesntexist",
126+
'--credentials-file=testing/resources/credentailsfilethatdoesntexist',
127127
))
128128
assert ret == 2
129129
out, _ = capsys.readouterr()
@@ -143,7 +143,7 @@ def test_non_existent_credentials_with_allow_flag(
143143
mock_secrets_file.return_value = set()
144144
ret = main((
145145
get_resource_path('aws_config_without_secrets.ini'),
146-
"--credentials-file=testing/resources/credentailsfilethatdoesntexist",
147-
"--allow-missing-credentials",
146+
'--credentials-file=testing/resources/credentailsfilethatdoesntexist',
147+
'--allow-missing-credentials',
148148
))
149149
assert ret == 0

tests/pretty_format_json_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_unsorted_main(filename, expected_retval):
4141
assert ret == expected_retval
4242

4343

44-
@pytest.mark.skipif(PY2, reason="Requires Python3")
44+
@pytest.mark.skipif(PY2, reason='Requires Python3')
4545
@pytest.mark.parametrize(
4646
('filename', 'expected_retval'), (
4747
('not_pretty_formatted_json.json', 1),

tests/sort_simple_yaml_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_integration_good_bad_lines(tmpdir, bad_lines, good_lines, retval):
4545
file_path = os.path.join(tmpdir.strpath, 'foo.yaml')
4646

4747
with open(file_path, 'w') as f:
48-
f.write("\n".join(bad_lines) + "\n")
48+
f.write('\n'.join(bad_lines) + '\n')
4949

5050
assert main([file_path]) == retval
5151

0 commit comments

Comments
 (0)