Skip to content

Commit

Permalink
chore: fix merge differences
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytelife26 committed Jan 25, 2024
1 parent b3ebed3 commit 90d610f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 135 deletions.
2 changes: 1 addition & 1 deletion proselint/checks/cliches/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def check_cliches_gnu_diction(text: str) -> list[ResultCheck]:

return existence_check(text, items, err, msg, ignore_case=True)

def check_cliches_nigel(text):
def check_cliches_nigel(text: str) -> list[ResultCheck]:
"""Check the text.
source: Nigel Ree's Dictionary of Cliches
Expand Down
1 change: 1 addition & 0 deletions proselint/config_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def names(cls) -> list[str]:
"nonwords.misc": True,
"oxymorons.misc": True,
"psychology.misc": True,
"punctuation_spacing.misc": True,
"redundancy.misc": True,
"redundancy.ras_syndrome": True,
"skunked_terms.misc": True,
Expand Down
48 changes: 4 additions & 44 deletions proselint/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,50 +182,10 @@ def lint_path(
results = {}
chars = 0

msg = " ".join(msg.split())

for w in word_pairs:
matches = [
[m for m in re.finditer(w[0], text)],
[m for m in re.finditer(w[1], text)]
]

if len(matches[0]) > 0 and len(matches[1]) > 0:

idx_minority = len(matches[0]) > len(matches[1])

for m in matches[idx_minority]:
errors.append((
m.start() + offset,
m.end() + offset,
err,
msg.format(w[~idx_minority], m.group(0)),
w[~idx_minority]))

return errors


def punctuation_check(text, pattern, err, msg, offset=0):
"""Build a checker for unnacceptable number of spaces behind puncuation."""
errors = []

period_spaces = re.finditer(pattern, text)

for inst in period_spaces:
errors.append((
inst.start() + offset,
inst.end() + offset,
err,
msg,
None))

return errors


def preferred_forms_check(text, list, err, msg, ignore_case=True, offset=0):
"""Build a checker that suggests the preferred form."""
if ignore_case:
flags = re.IGNORECASE
if len(paths) == 0:
# Use stdin if no paths were specified
log.info("No path specified -> will read from <stdin>")
results["<stdin>"] = lint(sys.stdin, config=config, checks=checks)
else:
# offer "outer" executor, to make multiprocessing more effective
exe = ProcessPoolExecutor() if config["parallelize"] else None
Expand Down
90 changes: 0 additions & 90 deletions tests/test_config_flag_proselintrc

This file was deleted.

0 comments on commit 90d610f

Please sign in to comment.