Skip to content

Commit 3c5a78c

Browse files
amurekicodingjoe
authored andcommitted
Fix various texts in code and README
For example, I replaced archaic "splited" in favor of "split".
1 parent 638f534 commit 3c5a78c

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Johannes Hoppe
3+
Copyright (c) 2018 Johannes Maron
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[![PyPi Version](https://img.shields.io/pypi/v/relint.svg)](https://pypi.python.org/pypi/relint/)
1010
[![Test Coverage](https://codecov.io/gh/codingjoe/relint/branch/main/graph/badge.svg)](https://codecov.io/gh/codingjoe/relint)
11-
[![GitHub License](https://img.shields.io/github/license/codingjoe/relint)](https://raw.githubusercontent.com/codingjoe/relint/master/LICENSE)
11+
[![GitHub License](https://img.shields.io/github/license/codingjoe/relint)](https://raw.githubusercontent.com/codingjoe/relint/main/LICENSE)
1212

1313
## Installation
1414

@@ -40,7 +40,7 @@ exit with a bad (non-zero) exit code. The default is `true`.
4040

4141
The following command will lint all files in the current directory:
4242

43-
```shell-session
43+
```shell
4444
relint -c .relint.yml **
4545
```
4646

Diff for: relint/parse.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ def split_diff_content_by_filename(output: str) -> {str: str}:
7474
"""
7575
content_by_filename = {}
7676
filenames = parse_filenames(output)
77-
splited_content = re.split(GIT_DIFF_SPLIT_PATTERN, output)
78-
splited_content = filter(lambda x: x != "", splited_content)
77+
split_content = re.split(GIT_DIFF_SPLIT_PATTERN, output)
78+
split_content = filter(lambda x: x != "", split_content)
7979

80-
for filename, content in zip(filenames, splited_content):
80+
for filename, content in zip(filenames, split_content):
8181
content_by_filename[filename] = content
8282
return content_by_filename
8383

Diff for: tests/fixtures/test.diff

+15-15
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ index 43032c5..e7203b3 100644
33
--- a/README.rst
44
+++ b/README.rst
55
@@ -51,7 +51,7 @@ If you prefer linting changed files (cached on git) you can use the option
6-
6+
77
.. code-block:: bash
8-
8+
99
- relint my_file.py --diff
1010
+ git diff | relint my_file.py --diff
11-
11+
1212
This option is useful for pre-commit purposes.
13-
13+
1414
diff --git a/relint.py b/relint.py
1515
index 31061ec..697a3f0 100644
1616
--- a/relint.py
1717
+++ b/relint.py
1818
@@ -113,7 +113,7 @@ def print_culprits(matches):
1919
for filename, test, match, _ in matches:
2020
exit_code = test.error if exit_code == 0 else exit_code
21-
21+
2222
- if filename != _filename:
2323
+ if filename != _filename: # TODO check this out
2424
_filename = filename
2525
lines = match.string.splitlines()
26-
26+
2727
@@ -167,7 +167,7 @@ def main():
2828
for path in paths
2929
)
30-
30+
3131
- if args.diff:
3232
+ if args.diff: # TODO wow
3333
output = sys.stdin.read()
@@ -40,20 +40,20 @@ index 7165fd3..249b783 100644
4040
@@ -54,8 +54,9 @@ class TestParseGitDiff:
4141
def test_split_diff_content(self):
4242
output = open('test.diff').read()
43-
splited = split_diff_content(output)
43+
split = split_diff_content(output)
4444
+
45-
assert isinstance(splited, dict)
46-
- assert len(splited) == 2
47-
+ assert len(splited) == 3
48-
45+
assert isinstance(split, dict)
46+
- assert len(split) == 2
47+
+ assert len(split) == 3
48+
4949
def test_return_empty_list_if_can_not_split_diff_content(self):
50-
splited = split_diff_content('')
50+
split = split_diff_content('')
5151
@@ -120,7 +121,7 @@ class TestParseGitDiff:
5252
"@@ -1,0 +2 @@\n" \
5353
"+# TODO: I'll do it later, promise\n"
54-
54+
5555
- parsed_content = parse_diff(output)
5656
+ parsed_content = parse_diff(output) # TODO brand new
5757
expected = {'test_relint.py': [2]}
58-
58+
5959
assert parsed_content == expected

Diff for: tests/test_parse.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ def test_parse_filenames(self, output, expected_filename):
4141
def test_split_diff_content(self, fixture_dir):
4242
with (fixture_dir / "test.diff").open() as fs:
4343
output = fs.read()
44-
splited = split_diff_content_by_filename(output)
44+
split = split_diff_content_by_filename(output)
4545

46-
assert isinstance(splited, dict)
47-
assert len(splited) == 3
46+
assert isinstance(split, dict)
47+
assert len(split) == 3
4848

4949
def test_return_empty_list_if_can_not_split_diff_content(self):
50-
splited = split_diff_content_by_filename("")
51-
assert splited == {}
50+
split = split_diff_content_by_filename("")
51+
assert split == {}
5252

5353
def test_return_empty_dict_when_diff_returns_empty(self):
5454
parsed_content = parse_diff("")

0 commit comments

Comments
 (0)