Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernization of proselint #1361

Closed
wants to merge 249 commits into from
Closed
Show file tree
Hide file tree
Changes from 118 commits
Commits
Show all changes
249 commits
Select commit Hold shift + click to select a range
140b3e0
added check for punctuation spacing. Issue #1342
arostkowycz15 Apr 17, 2023
451801f
Added clichés from Nigel Rees' book
mdgjohnny Sep 10, 2023
67be7fc
Tests for Nigel's clichés
mdgjohnny Sep 10, 2023
9db9d31
fix file endings and remove not needed spaces
orgua Dec 27, 2023
8defcc4
raise min py-version to 3.8 and remove future
orgua Dec 27, 2023
237ff5e
update deps
orgua Dec 27, 2023
98ce3d2
py: add commas
orgua Dec 27, 2023
9083fef
clean imports
orgua Dec 27, 2023
623d684
lint code
orgua Dec 27, 2023
f7d62d8
fix programming error
orgua Dec 27, 2023
fe731d0
chore(deps): bump ruby/setup-ruby from 1.95.0 to 1.163.0
dependabot[bot] Dec 27, 2023
e07daf6
chore(deps): bump codecov/codecov-action from 2.1.0 to 3.1.4
dependabot[bot] Dec 27, 2023
6ffbff7
chore(deps): bump actions/setup-python from 2 to 5
dependabot[bot] Dec 27, 2023
24e4032
chore(deps): bump actions/cache from 2 to 3
dependabot[bot] Dec 27, 2023
ac146da
chore(deps-dev): bump pytest from 6.2.5 to 7.4.3
dependabot[bot] Dec 27, 2023
0dc599c
Merge pull request #5 from orgua/dependabot/github_actions/actions/ca…
orgua Dec 27, 2023
d1ec014
Merge pull request #4 from orgua/dependabot/github_actions/actions/se…
orgua Dec 27, 2023
f3ab5cc
Merge pull request #6 from orgua/dependabot/pip/pytest-7.4.3
orgua Dec 27, 2023
791fbd7
chore(deps): bump actions/checkout from 2 to 4
dependabot[bot] Dec 27, 2023
53fe09f
Merge pull request #2 from orgua/dependabot/github_actions/actions/ch…
orgua Dec 27, 2023
f28b461
Merge pull request #1 from orgua/dependabot/github_actions/ruby/setup…
orgua Dec 27, 2023
2ef0a38
Merge pull request #3 from orgua/dependabot/github_actions/codecov/co…
orgua Dec 27, 2023
4aaeea6
do not pin package-versions if not needed
orgua Dec 27, 2023
62cbc93
clean up usage of paths
orgua Dec 27, 2023
873014f
remove legacy-code
orgua Dec 27, 2023
dbae823
avoid shadowing a Python builtins
orgua Dec 27, 2023
1e39e4d
sort imports
orgua Dec 28, 2023
b2ab749
add typehinting
orgua Dec 28, 2023
b24f5b1
format with black-style, ruff
orgua Dec 31, 2023
21947b0
add proper logging capability
orgua Dec 31, 2023
1af69f2
refactor internal paths
orgua Dec 31, 2023
64d4d6d
refactor cache
orgua Dec 31, 2023
147aee1
lint
orgua Dec 31, 2023
f2b91d6
refactor cache
orgua Dec 31, 2023
dd5a0f0
add chromalog and update deps
orgua Dec 31, 2023
54668e0
refactor logger
orgua Dec 31, 2023
c66ef43
various refactoring
orgua Dec 31, 2023
873022e
allow benchmarking & fix bugs
orgua Dec 31, 2023
5d8638a
small bugfixes
orgua Jan 1, 2024
8722878
chore(deps): bump ruby/setup-ruby from 1.163.0 to 1.165.1
dependabot[bot] Jan 1, 2024
6cbd9fe
chore(deps): bump crazy-max/ghaction-github-labeler from 3 to 5
dependabot[bot] Jan 1, 2024
f364082
replace memoiziation, improve code around it
orgua Jan 1, 2024
87f5832
consider age of cache-entries
orgua Jan 1, 2024
52f574e
optimize slowest funcs
orgua Jan 1, 2024
8fea336
remove tests for compiled-file-deletion
orgua Jan 1, 2024
c8368e7
refactor for modularity
orgua Jan 1, 2024
17fd756
last transformations to list comprehensions
orgua Jan 1, 2024
c24211b
Update poetry.lock
orgua Jan 1, 2024
2e468c7
refactor unittests (wip)
orgua Jan 2, 2024
bd5a3d1
remove duplicates
orgua Jan 2, 2024
458aacc
reformat
orgua Jan 2, 2024
625349c
Update config_default.py
orgua Jan 2, 2024
9f73969
refactor unittests
orgua Jan 2, 2024
ada3e7b
move tests for checks in separate folder
orgua Jan 2, 2024
666be5a
allow disabling cache
orgua Jan 2, 2024
3163e3c
small renaming & formatting
orgua Jan 2, 2024
567a517
extending sys.path not needed
orgua Jan 2, 2024
b33bc8f
propagate module-path
orgua Jan 2, 2024
69ffeab
refactor web-scripts
orgua Jan 2, 2024
8930e92
refactor new scripts
orgua Jan 2, 2024
644382a
refactor and reformat scripts
orgua Jan 2, 2024
45f657b
add cache-tests
orgua Jan 2, 2024
dae83c8
add config-tests
orgua Jan 2, 2024
f2dd797
add note to benchmark
orgua Jan 2, 2024
0c6ac6f
add printer for invoke()
orgua Jan 2, 2024
ce47da9
revert renaming txt-file for tests
orgua Jan 2, 2024
af65ec7
update configs in sync to available tests
orgua Jan 2, 2024
4d35420
fix tests
orgua Jan 2, 2024
2055bec
catch missing modules, make ppm-wrapper nicer
orgua Jan 2, 2024
7dc2f58
add exithandler and return number of results as exit-code
orgua Jan 2, 2024
4943d6d
Update test_cache_function.py
orgua Jan 2, 2024
ebef8e0
Update test_config_default.py
orgua Jan 2, 2024
2e5c2f4
workflows make version to string
orgua Jan 2, 2024
12e68ba
Merge pull request #12 from orgua/dependabot/github_actions/crazy-max…
orgua Jan 2, 2024
5f86848
Merge pull request #11 from orgua/dependabot/github_actions/ruby/setu…
orgua Jan 2, 2024
fb72dd6
sort dev-deps, also include pre-commit and remove packages covered by…
orgua Jan 2, 2024
1d69912
Update ci-lint-test.yml
orgua Jan 2, 2024
a67a7f4
Merge branch 'main' of https://github.com/orgua/proselint-modernized
orgua Jan 2, 2024
59d1eec
add multiprocessing for checks
orgua Jan 3, 2024
fb09191
ditch chromalog-package
orgua Jan 3, 2024
1bc6276
parallelize lint()
orgua Jan 3, 2024
e45b917
remove memoizer for checks
orgua Jan 3, 2024
a3b78a1
extend benchmark scripts
orgua Jan 3, 2024
82f671c
extend cache to handle const-properties
orgua Jan 3, 2024
44bfd7e
refactor sexism-check and extend unittests
orgua Jan 3, 2024
edb8b5f
minor fixes
orgua Jan 3, 2024
d2fa1b8
refactor more checks and tests
orgua Jan 3, 2024
4a845b2
fix check_option join & require_padding
orgua Jan 3, 2024
4bfb81a
even out load of checks for extreme cases
orgua Jan 4, 2024
471b241
add pytest-cov dependency
orgua Jan 4, 2024
efeb957
fix check-tests
orgua Jan 4, 2024
956f943
fix test for caching
orgua Jan 4, 2024
b87d194
remove const-cache after benchmarking
orgua Jan 4, 2024
201d7ee
refactor all multiprocessed code into submodule
orgua Jan 4, 2024
769123f
clean up from latest debug session
orgua Jan 4, 2024
7ef28ce
change config
orgua Jan 4, 2024
464f41b
fix unittests
orgua Jan 4, 2024
ccb6c8a
linting
orgua Jan 4, 2024
ccbcf7a
cache is now a singleton
orgua Jan 4, 2024
4cb1813
Update tools.py
orgua Jan 4, 2024
dc4da55
Update test_hyperlinks_on_shell.py
orgua Jan 4, 2024
f4a9fc2
add padding to text - guard against edge-cases
orgua Jan 4, 2024
8a78b9c
rename lint_cache
orgua Jan 4, 2024
f764def
force single-line imports
orgua Jan 4, 2024
7a5e4c3
add global executor and optimize memoizer
orgua Jan 4, 2024
560eabd
optimize check-message
orgua Jan 4, 2024
1de71f7
lint code
orgua Jan 4, 2024
0d87b24
add current ruff-config
orgua Jan 4, 2024
92d72f4
overhaul output-format system
orgua Jan 5, 2024
741639d
store filename in error-list
orgua Jan 5, 2024
7bd74e0
fix bug in memoizer
orgua Jan 5, 2024
87c23a6
improve memoizer
orgua Jan 5, 2024
8a4aa20
fix padding in some checks
orgua Jan 5, 2024
6ef3a1a
improve commercialese
orgua Jan 5, 2024
f3d3657
improve memoizer
orgua Jan 5, 2024
52e445a
Update score.py
orgua Jan 5, 2024
ceb06ee
add weasel words
orgua Jan 5, 2024
e72d054
fix unittests
orgua Jan 5, 2024
2632d2b
speed up scripts
orgua Jan 5, 2024
a3e9af2
move printing out of linter
orgua Jan 5, 2024
e49149e
Merge branch 'pr/1356'
orgua Jan 5, 2024
413cf62
Update test_cliches.py
orgua Jan 5, 2024
5a552be
fix code
orgua Jan 5, 2024
4b09ec2
fix unittests and lint
orgua Jan 5, 2024
ac40919
bump version
orgua Jan 14, 2024
7548c80
Merge branch 'main' into main
Nytelife26 Jan 22, 2024
3fbaaef
ci(lint-test): fix pytest
Nytelife26 Jan 24, 2024
d3213d6
fix file endings and remove not needed spaces
orgua Dec 27, 2023
6eb6949
raise min py-version to 3.8 and remove future
orgua Dec 27, 2023
a04b80b
update deps
orgua Dec 27, 2023
b552b74
py: add commas
orgua Dec 27, 2023
691a145
clean imports
orgua Dec 27, 2023
4c155b1
lint code
orgua Dec 27, 2023
1434a98
fix programming error
orgua Dec 27, 2023
912e965
chore(deps): bump actions/cache from 2 to 3
dependabot[bot] Dec 27, 2023
f14ce3a
chore(deps): bump actions/setup-python from 4 to 5
dependabot[bot] Dec 27, 2023
6d6d995
chore(deps-dev): bump pytest from 6.2.5 to 7.4.3
dependabot[bot] Dec 27, 2023
a0f8bc7
chore(deps): bump actions/checkout from 2 to 4
dependabot[bot] Dec 27, 2023
eefe9f1
chore(deps): bump ruby/setup-ruby from 1.95.0 to 1.163.0
dependabot[bot] Dec 27, 2023
03b91ab
do not pin package-versions if not needed
orgua Dec 27, 2023
75cd2b7
clean up usage of paths
orgua Dec 27, 2023
41ac3bd
remove legacy-code
orgua Dec 27, 2023
a0e43e8
avoid shadowing a Python builtins
orgua Dec 27, 2023
4b1e5c7
sort imports
orgua Dec 28, 2023
3988867
add typehinting
orgua Dec 28, 2023
18d22c0
format with black-style, ruff
orgua Dec 31, 2023
c4fdcfa
add proper logging capability
orgua Dec 31, 2023
391bafb
refactor internal paths
orgua Dec 31, 2023
938f157
refactor cache
orgua Dec 31, 2023
31cc235
lint
orgua Dec 31, 2023
ce94896
refactor cache
orgua Dec 31, 2023
2e74b61
add chromalog and update deps
orgua Dec 31, 2023
fa9f6cd
refactor logger
orgua Dec 31, 2023
a07fa34
various refactoring
orgua Dec 31, 2023
12bd14a
allow benchmarking & fix bugs
orgua Dec 31, 2023
d97811a
small bugfixes
orgua Jan 1, 2024
7e62d8b
replace memoiziation, improve code around it
orgua Jan 1, 2024
d41ca24
consider age of cache-entries
orgua Jan 1, 2024
3b51220
optimize slowest funcs
orgua Jan 1, 2024
fcc7d29
remove tests for compiled-file-deletion
orgua Jan 1, 2024
f0dc9cf
refactor for modularity
orgua Jan 1, 2024
b58f140
last transformations to list comprehensions
orgua Jan 1, 2024
6cffecf
refactor unittests (wip)
orgua Jan 2, 2024
457c832
remove duplicates
orgua Jan 2, 2024
3da41d8
reformat
orgua Jan 2, 2024
74a726c
Update config_default.py
orgua Jan 2, 2024
58b7a42
refactor unittests
orgua Jan 2, 2024
b32d853
move tests for checks in separate folder
orgua Jan 2, 2024
c1bfeea
allow disabling cache
orgua Jan 2, 2024
b8e7048
small renaming & formatting
orgua Jan 2, 2024
870671e
extending sys.path not needed
orgua Jan 2, 2024
fc8a356
propagate module-path
orgua Jan 2, 2024
7bb9d3e
refactor web-scripts
orgua Jan 2, 2024
f7fa09f
refactor new scripts
orgua Jan 2, 2024
4e4a596
refactor and reformat scripts
orgua Jan 2, 2024
9e0307e
add cache-tests
orgua Jan 2, 2024
54631fb
add config-tests
orgua Jan 2, 2024
cb23bb9
add note to benchmark
orgua Jan 2, 2024
05871d9
add printer for invoke()
orgua Jan 2, 2024
ffecc43
revert renaming txt-file for tests
orgua Jan 2, 2024
53dc973
update configs in sync to available tests
orgua Jan 2, 2024
5828288
fix tests
orgua Jan 2, 2024
14beecb
catch missing modules, make ppm-wrapper nicer
orgua Jan 2, 2024
f53c55e
add exithandler and return number of results as exit-code
orgua Jan 2, 2024
a13cc04
Update test_cache_function.py
orgua Jan 2, 2024
c1db241
Update test_config_default.py
orgua Jan 2, 2024
ac334fa
workflows make version to string
orgua Jan 2, 2024
f81bf0b
sort dev-deps, also include pre-commit and remove packages covered by…
orgua Jan 2, 2024
dd86494
Update ci-lint-test.yml
orgua Jan 2, 2024
0e7d620
chore(deps): bump crazy-max/ghaction-github-labeler from 3 to 5
dependabot[bot] Jan 1, 2024
1829d4b
chore(deps): bump ruby/setup-ruby from 1.163.0 to 1.165.1
dependabot[bot] Jan 1, 2024
66ab691
add multiprocessing for checks
orgua Jan 3, 2024
e7d70b2
ditch chromalog-package
orgua Jan 3, 2024
7ef4d60
parallelize lint()
orgua Jan 3, 2024
fd96434
remove memoizer for checks
orgua Jan 3, 2024
1ae3926
extend benchmark scripts
orgua Jan 3, 2024
9d677fe
extend cache to handle const-properties
orgua Jan 3, 2024
cf6384f
refactor sexism-check and extend unittests
orgua Jan 3, 2024
25e1a9d
minor fixes
orgua Jan 3, 2024
98a7980
refactor more checks and tests
orgua Jan 3, 2024
cae7728
fix check_option join & require_padding
orgua Jan 3, 2024
22bf2fc
even out load of checks for extreme cases
orgua Jan 4, 2024
5eab18c
add pytest-cov dependency
orgua Jan 4, 2024
f323c5d
fix check-tests
orgua Jan 4, 2024
1768bb5
fix test for caching
orgua Jan 4, 2024
78a703f
remove const-cache after benchmarking
orgua Jan 4, 2024
c177a65
refactor all multiprocessed code into submodule
orgua Jan 4, 2024
d9cdfd3
clean up from latest debug session
orgua Jan 4, 2024
521b076
change config
orgua Jan 4, 2024
a302e4c
fix unittests
orgua Jan 4, 2024
aaba845
linting
orgua Jan 4, 2024
e3b7b02
cache is now a singleton
orgua Jan 4, 2024
998d0f5
Update tools.py
orgua Jan 4, 2024
6744baf
Update test_hyperlinks_on_shell.py
orgua Jan 4, 2024
e4535c1
add padding to text - guard against edge-cases
orgua Jan 4, 2024
b03c870
rename lint_cache
orgua Jan 4, 2024
23a54f4
force single-line imports
orgua Jan 4, 2024
e294602
add global executor and optimize memoizer
orgua Jan 4, 2024
c4ecb77
optimize check-message
orgua Jan 4, 2024
4c1016e
lint code
orgua Jan 4, 2024
5e2ea1b
add current ruff-config
orgua Jan 4, 2024
3c44e3b
overhaul output-format system
orgua Jan 5, 2024
0a32450
store filename in error-list
orgua Jan 5, 2024
771788d
fix bug in memoizer
orgua Jan 5, 2024
f53a531
improve memoizer
orgua Jan 5, 2024
d7d78f6
fix padding in some checks
orgua Jan 5, 2024
529efbe
improve commercialese
orgua Jan 5, 2024
5ef1d75
improve memoizer
orgua Jan 5, 2024
52da9f3
Update score.py
orgua Jan 5, 2024
94956d5
add weasel words
orgua Jan 5, 2024
7b1a232
fix unittests
orgua Jan 5, 2024
a2c2d48
speed up scripts
orgua Jan 5, 2024
d4bf985
move printing out of linter
orgua Jan 5, 2024
a8af783
Added clichés from Nigel Rees' book
mdgjohnny Sep 10, 2023
185c344
Tests for Nigel's clichés
orgua Jan 5, 2024
c1d67df
added check for punctuation spacing. Issue #1342
arostkowycz15 Apr 17, 2023
a60cc86
fix unittests and lint
orgua Jan 5, 2024
84a40ab
bump version
orgua Jan 14, 2024
b3ebed3
ci(lint-test): fix pytest
Nytelife26 Jan 24, 2024
90d610f
chore: fix merge differences
Nytelife26 Jan 25, 2024
2104094
chore: resolve rebase issues
Nytelife26 Jan 25, 2024
64bb526
chore(deps): add ruff
Nytelife26 Jan 25, 2024
fc5e10a
lint: fix ruff suggestions
Nytelife26 Jan 25, 2024
30f1972
ci(lint-test): lint with ruff
Nytelife26 Jan 25, 2024
cefb7a3
chore: fix lint issues
Nytelife26 Jan 25, 2024
c1cc4db
Merge branch 'main' of https://github.com/orgua/proselint-modernized
orgua Jan 25, 2024
ee7dbf4
Update tests/check.py
orgua Jan 25, 2024
fa9b0cd
implement comments
orgua Jan 25, 2024
eb414d1
Merge branch 'main' of https://github.com/orgua/proselint-modernized
orgua Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ assignees: ''

## Logs & Screenshots

<!-- If applicable, add screenshots to help explain your problem, or
<!-- If applicable, add screenshots to help explain your problem, or
alternatively add your console logs here. -->

## Environment
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/false-positive.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ assignees: ''

## Logs & Screenshots

<!-- If applicable, add screenshots to help explain your problem, or
<!-- If applicable, add screenshots to help explain your problem, or
alternatively add your console logs here. -->

## Environment
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
shell: bash
strategy:
matrix:
python: [3.9]
python: ["3.10"]
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "[INIT] Install Python ${{ matrix.python }}"
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: "[INIT] Install Poetry"
uses: snok/[email protected]
- name: "[INIT] Restore dependency cache"
id: cache-restore
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/pip
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cd-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
shell: bash
strategy:
matrix:
python: [3.9]
ruby: [3.0.0]
python: ["3.10"]
ruby: ["3.0.0"]
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "[INIT] Install Python ${{ matrix.python }}"
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: "[INIT] Install Ruby ${{ matrix.ruby }}"
uses: ruby/setup-ruby@v1.95.0
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
shell: bash
strategy:
matrix:
ruby: [3.0.0]
ruby: ["3.0.0"]
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: "[INIT] Install Ruby ${{ matrix.ruby }}"
uses: ruby/setup-ruby@v1.95.0
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "[EXEC] Synchronize labels"
uses: crazy-max/ghaction-github-labeler@v3
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
36 changes: 22 additions & 14 deletions .github/workflows/ci-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
python: ["3.10"]
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "[INIT] Install Python ${{ matrix.python }}"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: "[INIT] Install Poetry"
Expand All @@ -30,9 +30,12 @@ jobs:
key: ${{ runner.os }}-py${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
- name: "[INIT] Install dependencies"
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: pip install poetry && poetry install
run: poetry install
- name: "[EXEC] Lint"
run: ./utils ci lint
uses: chartboost/ruff-action@v1
# - name: Run Pre-Commit Tests 🧪
# uses: pre-commit/[email protected]

test-cover:
name: Test & Cover
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
Expand All @@ -42,13 +45,14 @@ jobs:
shell: bash
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "pypy3.9", "pypy3.10"]
# 5 versions / years of coverage
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "[INIT] Install Python ${{ matrix.python }}"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: "[INIT] Install Poetry"
Expand All @@ -64,10 +68,14 @@ jobs:
- name: "[INIT] Install dependencies"
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: pip install poetry && poetry install
- name: "[EXEC] Test"
run: ./utils ci test --coverage
- name: "[EXEC] Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
flags: ${{ matrix.os }},py${{ matrix.python }}
- name: "[EXEC] Test build package"
run: poetry build
- name: "[EXEC] Unit test"
run: poetry run pytest
# - name: "[EXEC] Test"
# run: ./utils ci test --coverage
# - name: "[EXEC] Upload coverage to Codecov"
# uses: codecov/[email protected] # TODO: maybe not on every py-ver?
# with:
# fail_ci_if_error: true
# flags: ${{ matrix.os }},py${{ matrix.python }}
75 changes: 75 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

line-length = 80
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we at least compromise on 88 chars, as it is widely used by black? 80 chars are a relic from the 80's a bit of from the current sweetspot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

88 is a non-standard line length. Sure, 80 characters is an old requirement, but I find you can pretty much always achieve what you need to and it forces you to keep things clean.

It's personal preference, I suppose, but since I refactored proselint the first time it has used 80 character line lengths.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

black is the current standard (as it is widely used) in python world - even ruff adopted it and formats the same :)
but ok

Copy link
Contributor

@ferdnyc ferdnyc May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black's completely arbitrary, sarcastically-justified 88-character line length is one of its more controversial "opinions", though.

Particularly as it violates PEP8 — an actual standard, not (at best) a "de facto standard" like Black. (Though PEP8 admittedly did itself no favors by specifying 79 characters instead of 80, something that was met with almost immediate, near-universal rejection.)

IIRC line length was also the very first configuration option Black gained, once its original vision of being completely non-configurable collided headfirst with reality.

target-version = "py38"

[lint]
select = [
"A", # flake8-builtins
# "ANN", # flake8-annotations TODO activate
# "ARG", # flake8-unused-arguments
"B", # Bugbear
"C",
"COM", # flake8-commas
# "CPY", # flake8-copyright
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
# "D", # pydocstyle, TODO: activate
"E", # pycodestyle errors
# "ERA", # eradicate commented out code
"F", # pyflakes
"FA", # flake8-future-annotations
# "FBT", # boolean traps
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # incomplete isort
"INP", # flake8-no-pep420
"LOG", # flake8-logging
# "N", # naming
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"PERF", # Perflint
"PL", # Pylint
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RUF", # Ruff-specific rules
"S", # bandit, security
"SLF", # flake8-self
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"T10", # flake8-print
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
"PLR2004", # magic values
"COM812", # trailing comma -> done by formatter
# TODO: below is temporary

]
preview = true

[lint.per-file-ignores]
"tests/**" = ["S", "N8", "SLF001", "PLR2004"]
"proselint/checks/**" = ["RUF001", "RUF002", "RUF003", "TID252"]
"scripts/**" = ["E501", "DTZ005"]

"plugins/**" = ["INP001", "RUF012"]
"scripts_web/**" = ["S1", "SIM", "RET", "TCH"]

[lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 11

[lint.isort]
force-single-line = true
Comment on lines +67 to +68
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[lint.isort]
force-single-line = true

I think this should be removed. It makes imports unwieldy.


[lint.pyupgrade]
keep-runtime-typing = true

[format]
# per default like Black
#preview = true
126 changes: 126 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,131 @@
# Change Log

## [[email protected]](https://github.com/amperser/proselint/compare/0.13.0...0.15.0)

### Biggest Changes

- featureset of py38
- cleaner and faster code
- fixed bugs, undefined behavior, broken legacy code
- some checks did not work as intended
- multiprocessed parallelization and other optimizations

### Benchmark-Comparison

- custom set of files, same hardware

#### Windows

Proselint-main (uncached & cached)

- Found 104 lint-warnings in 47.579 s
- Found 104 lint-warnings in 0.878 s

Proselint-modernized

- Found 108 lint-warnings in 39.930 s (12 files, 617.45 kiByte) -> serialized
- Found 108 lint-warnings in 13.164 s (12 files, 617.45 kiByte) -> serial files, parallel checks
- Found 108 lint-warnings in 9.931 s (12 files, 617.45 kiByte) -> global check-executor
- Found 108 lint-warnings in 0.011 s (12 files, 617.45 kiByte) -> cached

#### Linux / WSL

Proselint-main (uncached & cached)

- Found 104 lint-warnings in 37.041 s
- Found 104 lint-warnings in 0.771 s

Proselint-modernized

- Found 108 lint-warnings in 34.521 s (12 files, 617.45 kiByte)
- Found 108 lint-warnings in 8.248 s (12 files, 617.45 kiByte)
- Found 108 lint-warnings in 6.098 s (12 files, 617.45 kiByte)
- Found 108 lint-warnings in 0.044 s (12 files, 617.45 kiByte)

### Breaking changes

- cli arg `--time` -> `--benchmark`, `-b`
- cli arg `--debug` -> `--verbose`, `-v`
- exit code now returns number of errors
- cli arg `--output-format` controls old flags json, compact
- py >= 3.8
- api-changes -> web_scripts & plugins untested
- config adjustments (1 test removed, 1 added)
- "misc.metaconcepts": False, # TODO: remove, was duplicate of scare_quotes

### Whats broken / untested

- web_scripts
- plugins
- Github action


### Detailed Changelog

- featureset of py38
- use pathlib instead of string based paths
- add type-hinting
- replaced memoizer, short-comings:
- shelves have a good interface but are slow
- cache-init and -closing was a mess
- clearing cache resulted in broken states
- memoize-wrapper was wasting resources (hash of text recalc for every check, ..)
- age of cache-entries was not considered
- every cached fn had its own file-cache
- cache migration was done on every memoize-decoration
- cache
- hash test beforehand only once
- consider age of items
- memoize lint() instead of checks
- fix bugs related to:
- overshadowing builtin names (list, ...)
- string based path-traversal
- mix of relative and absolute paths (also relics that deleted file somewhere)
- varius small bugs (ie. missing comma in element lists)
- cache was not cleaned up by fn (as it should)
- lots of modernization from old codebase
- latest python versions had trouble with proselint
- update deps
- reformat using black-style, done by ruff
- linted codebase with ruff
- add logger and refactor print-output
- linter informs about duration
- results include link to file
- inform about duration, files scanned and text-size
- refactor unittest
- remove classes / boilerplate
- move tests for checks into separate dir
- more helpful error-messages
- remove duplicates
- repair broken tests
- lower complexity of tests (each test should only test for one thing)
- add unittests
- detect missing check-flags in default-config
- find unavaible checks for default-config-flags
- don't fail on wrong config-flags
- check working cache, speed-test
- check working cache, same results
- minimal changes to outer api
- config
- correctness of default-config is tested
- don't fail on faulty config-flags
- checks
- remove duplicates
- fix padding for checks using regex
- existence_check() - join and padding -> cleared up
- join is always done
- padding can be selected py Enum, defaults to separate in text
- fix checks accordingly
- put root-scripts into sep dir
- exithandler for more graceful ctrl+c
- ppm-wrapper is now more forgiving with small sample-sizes
- add parallelization
- checks() are run multiprocessed
- one global executioner collects tasks for all files to analyze
- break up the slowest checks to balance the load
- optimizations were done with profiling and benchmarking
- overhaul controling output-format by cli

## [[email protected]](https://github.com/amperser/proselint/compare/0.12.0...0.13.0)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2014–2015, Jordan Suchow, Michael Pacer, and Lara A. Ross
Copyright © 2014–2015, Jordan Suchow, Michael Pacer, and Lara A. Ross
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include README.md LICENSE.md CHANGELOG.md tests/illegal-chars.txt tests/*.py tests/test_gmeu/*.py
include README.md LICENSE.md CHANGELOG.md tests/illegal-chars.txt tests/*.py tests/test_gmeu/*.py
4 changes: 2 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: gunicorn app:app --log-file=-
worker: python worker.py
clock: python clock.py
worker: python scripts/worker.py
clock: python scripts/clock.py
Loading
Loading