Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Add ignore-self-only-init option #560

Merged
merged 9 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into unary_init
  • Loading branch information
thejcannon committed Oct 25, 2022
commit 193a366242380a422b09f615557397ca34983c9a
5 changes: 5 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ New Features
* Add support for `property_decorators` config to ignore D401.
* Add support for Python 3.10 (#554).
* Add `ignore-self-only-init` config (#560).
thejcannon marked this conversation as resolved.
Show resolved Hide resolved
* Replace D10X errors with D419 if docstring exists but is empty (#559).

Bug Fixes

* Fix ``--match`` option to only consider filename when matching full paths (#550).

6.1.1 - May 17th, 2021
---------------------------
Expand Down
21 changes: 21 additions & 0 deletions src/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,3 +1504,24 @@ def __init__(self):
out, err, code = env.invoke()
assert '' == out
assert code == 0

def test_match_considers_basenames_for_path_args(env):
"""Test that `match` option only considers basenames for path arguments.

The test environment consists of a single empty module `test_a.py`. The
match option is set to a pattern that ignores test_ prefixed .py filenames.
When pydocstyle is invoked with full path to `test_a.py`, we expect it to
succeed since match option will match against just the file name and not
full path.
"""
# Ignore .py files prefixed with 'test_'
env.write_config(select='D100', match='(?!test_).+.py')

# Create an empty module (violates D100)
with env.open('test_a.py', 'wt') as test:
test.write('')

# env.invoke calls pydocstyle with full path to test_a.py
out, _, code = env.invoke(target='test_a.py')
assert '' == out
assert code == 0
You are viewing a condensed version of this merge commit. You can view the full changes here.