Skip to content

Conversation

@RyanMcCarl
Copy link

This is my first attempt to contribute, so please let me know if I need to do anything differently -- e.g. register the check with the application.

I haven't tested the regex extensively, but it performed well on this list.

Here are the results on Pythex:

Passive voice regex test 2018-06-12.pdf

Here is the regex itself -- I'm sure it can be improved, modularized into several regexes, etc. Happy to continue working on it when I can if you like the idea.

(\b(?:be|am|is|are|was|were|have|has|had)\b[\w\s]{,15}?(?:d|(?<!whe)n|ne|left|being)\b(?: by\b)?)

@RyanMcCarl
Copy link
Author

I'm having trouble getting this through the checks even after rebasing the repository. Can anyone tell me what I'm doing wrong? @mpacer @suchow

@Nytelife26
Copy link
Contributor

It seems that for the most part this PR is, well, broken. Its contents appear to be lost in over 372 changed files. Using regexes to hack together a passive voice check also doesn't seem ideal.

With that being said, I think we'll have to close this, unless you're available to work on it @RyanMcCarl.

@suchow
Copy link
Contributor

suchow commented May 24, 2021

@Nytelife26 Even if Ryan can’t work on this, it’s worth salvaging what we can from the PR. There are new modules buried in here based on Ryan’s professional expertise (he’s a lawyer and scholar who has taught advanced legal writing courses and does research on use of A.I. in law).

@suchow
Copy link
Contributor

suchow commented May 24, 2021

In particular, see proselint/checks/mccarl/rm_style_pref_forms.py

@Nytelife26
Copy link
Contributor

Ah, I see. I may have to root through the diffs and cherry-pick useful files, then - I didn't have time to review them all due to the mostly broken structure and the number of file changes.

I'll take a look now, though.

@codecov
Copy link

codecov bot commented May 30, 2021

Codecov Report

Merging #802 (7ada6b8) into main (f8928ad) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 7ada6b8 differs from pull request most recent head b48ea45. Consider uploading reports for the commit b48ea45 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #802      +/-   ##
==========================================
+ Coverage   94.72%   94.75%   +0.03%     
==========================================
  Files          83       84       +1     
  Lines        1213     1221       +8     
==========================================
+ Hits         1149     1157       +8     
  Misses         64       64              
Flag Coverage Δ
macos-latest 94.75% <100.00%> (+0.03%) ⬆️
py3.6 94.24% <100.00%> (+0.03%) ⬆️
py3.7 94.24% <100.00%> (+0.03%) ⬆️
py3.8 94.75% <100.00%> (+0.03%) ⬆️
py3.9 94.75% <100.00%> (+0.03%) ⬆️
pypypy3 94.24% <100.00%> (+0.03%) ⬆️
ubuntu-latest 94.75% <100.00%> (+0.03%) ⬆️
windows-latest 94.75% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
proselint/checks/passive_voice/misc.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8928ad...b48ea45. Read the comment docs.

@Nytelife26
Copy link
Contributor

I will review the Garner checks now as it is likely they are already present in another check since we have most of GMEU implemented. The McCarl checks and passive voice check will additionally need to be split up into two separate PRs before this can continue.

@Nytelife26
Copy link
Contributor

Nytelife26 commented Jul 5, 2021

The regex needs to be adjusted to pass the special cases checks. Perhaps the exceptions functionality might make that easier.

@Nytelife26 Nytelife26 added the cat: new-check Extraction and implementation of, or a request for, a new check label Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat: new-check Extraction and implementation of, or a request for, a new check type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants