Skip to content

Commit

Permalink
style: switch pycodestyle -> flake8 (#1198)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytelife26 authored Jul 6, 2021
1 parent 0816a5b commit 8e0f740
Show file tree
Hide file tree
Showing 183 changed files with 512 additions and 512 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: pip install poetry && poetry install
- name: "[EXEC] Lint"
run: poetry run pycodestyle --config pyproject.toml . && poetry run pydocstyle .
run: poetry run flake8 proselint && poetry run pydocstyle proselint
test-cover:
name: Test & Cover
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
Expand Down
98 changes: 96 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion proselint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# flake8: noqa

"""Proselint applies advice from great writers to your writing."""
from . import tools

__all__ = ('tools')
__all__ = ("tools")
3 changes: 1 addition & 2 deletions proselint/checks/airlinese/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Airlinese.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "airlinese.misc"
msg = u"'{}' is airlinese."
msg = "'{}' is airlinese."

airlinese = [
"enplan(?:e|ed|ing|ement)",
Expand Down
3 changes: 1 addition & 2 deletions proselint/checks/annotations/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Annotation left in text.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "annotations.misc"
msg = u"Annotation left in text."
msg = "Annotation left in text."

annotations = [
"FIXME",
Expand Down
3 changes: 1 addition & 2 deletions proselint/checks/archaism/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Archaism.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "archaism.misc"
msg = u"'{}' is archaic."
msg = "'{}' is archaic."

archaisms = [
"alack",
Expand Down
3 changes: 1 addition & 2 deletions proselint/checks/cliches/hell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Too much yelling.
---
Expand All @@ -20,7 +19,7 @@
def check_repeated_exclamations(text):
"""Check the text."""
err = "leonard.hell"
msg = u"Never use the words 'all hell broke loose'."
msg = "Never use the words 'all hell broke loose'."

regex = r"all hell broke loose"

Expand Down
12 changes: 5 additions & 7 deletions proselint/checks/cliches/misc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""Cliches are cliché."""

u"""Cliches are cliché."""

from proselint.tools import memoize, existence_check
from proselint.tools import existence_check, memoize


@memoize
Expand All @@ -13,7 +11,7 @@ def check_cliches_garner(text):
source_url: http://bit.ly/1T4alrY
"""
err = "cliches.garner"
msg = u"'{}' is cliché."
msg = "'{}' is cliché."

cliches = [
"a fate worse than death",
Expand Down Expand Up @@ -107,7 +105,7 @@ def check_cliches_write_good(text):
source_url: https://github.com/btford/write-good
"""
err = "cliches.write_good"
msg = u"'{}' is a cliché."
msg = "'{}' is a cliché."

cliches = [
"a chip off the old block",
Expand Down Expand Up @@ -820,7 +818,7 @@ def check_cliches_gnu_diction(text):
source_url: https://directory.fsf.org/wiki/Diction
"""
err = "cliches.gnu_diction"
msg = u"'{}' is a cliché."
msg = "'{}' is a cliché."

list = [
"a matter of concern",
Expand Down
1 change: 0 additions & 1 deletion proselint/checks/consistency/spacing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Mixed one vs. two spaces after a period.
---
Expand Down
1 change: 0 additions & 1 deletion proselint/checks/consistency/spelling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Inconsistent spelling.
---
Expand Down
2 changes: 1 addition & 1 deletion proselint/checks/corporate_speak/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
u"""Corporate-speak."""
"""Corporate-speak."""
3 changes: 1 addition & 2 deletions proselint/checks/corporate_speak/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Corporate speak.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "corporate_speak.misc"
msg = u"Minimize your use of corporate catchphrases like this one."
msg = "Minimize your use of corporate catchphrases like this one."

list = [
"at the end of the day",
Expand Down
3 changes: 1 addition & 2 deletions proselint/checks/cursing/filth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Filthy words.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "cursing.filth"
msg = u"""Nobody ever tells you this as a kid, but you're supposed to avoid
msg = """Nobody ever tells you this as a kid, but you're supposed to avoid
this word."""

list = [
Expand Down
3 changes: 1 addition & 2 deletions proselint/checks/cursing/nfl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Words the NFL won't print on a jersey.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "cursing.nfl"
msg = u"The NFL won't print this word on a jersey."
msg = "The NFL won't print this word on a jersey."

list = [
"420",
Expand Down
3 changes: 1 addition & 2 deletions proselint/checks/cursing/nword.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""On 'the N word'.
---
Expand All @@ -20,7 +19,7 @@
def check(text):
"""Check the text."""
err = "cursing.nword"
msg = u"Take responsibility for the shitty words you want to say."
msg = "Take responsibility for the shitty words you want to say."

list = [
"the n-word",
Expand Down
13 changes: 6 additions & 7 deletions proselint/checks/dates_times/am_pm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
u"""a.m. / p.m.
"""a.m. / p.m.
---
layout: post
Expand All @@ -11,14 +10,14 @@
---
"""
from proselint.tools import memoize, existence_check
from proselint.tools import existence_check, memoize


@memoize
def check_lowercase_periods(text):
"""Check the text."""
err = "dates_times.am_pm.lowercase_periods"
msg = u"With lowercase letters, the periods are standard."
msg = "With lowercase letters, the periods are standard."

return existence_check(text, [r"\d{1,2} ?[ap]m"], err, msg)

Expand All @@ -27,7 +26,7 @@ def check_lowercase_periods(text):
def check_spacing(text):
"""Check the text."""
err = "dates_times.am_pm.spacing"
msg = u"It's standard to put a space before 'a.m.' or 'p.m.'."
msg = "It's standard to put a space before 'a.m.' or 'p.m.'."

return existence_check(text, [r"\d{1,2}[ap]\.?m\.?"], err, msg)

Expand All @@ -36,7 +35,7 @@ def check_spacing(text):
def check_midnight_noon(text):
"""Check the text."""
err = "dates_times.am_pm.midnight_noon"
msg = (u"12 a.m. and 12 p.m. are wrong and confusing."
msg = ("12 a.m. and 12 p.m. are wrong and confusing."
" Use 'midnight' or 'noon'.")

return existence_check(text, [r"12 ?[ap]\.?m\.?"], err, msg)
Expand All @@ -46,7 +45,7 @@ def check_midnight_noon(text):
def check_redundancy(text):
"""Check the text."""
err = "dates_times.am_pm.midnight_noon"
msg = (u"'a.m.' is always morning; 'p.m.' is always night.")
msg = ("'a.m.' is always morning; 'p.m.' is always night.")

list = [
r"\d{1,2} ?a\.?m\.? in the morning",
Expand Down
Loading

0 comments on commit 8e0f740

Please sign in to comment.