PyCQA / pydocstyle

docstring style checker
http://pydocstyle.org
MIT License
1.11k stars 189 forks source link

Version 6.2.x breakes pylama #621

Closed urmich closed 1 year ago

urmich commented 1 year ago

I am getting this error since version 6.2.X was released (it was stable with version 6.1.1):

2023-01-04T06:44:25.4284650Z File "/opt/hostedtoolcache/Python/3.8.15/x64/bin/pylama", line 8, in 2023-01-04T06:44:25.4285243Z sys.exit(shell()) 2023-01-04T06:44:25.4286919Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pylama/main.py", line 115, in shell 2023-01-04T06:44:25.4287643Z errors = check_paths( 2023-01-04T06:44:25.4288717Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pylama/main.py", line 68, in check_paths 2023-01-04T06:44:25.4289610Z errors += run(path=path, code=code, rootdir=rootdir, options=options) 2023-01-04T06:44:25.4290788Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pylama/core.py", line 36, in run 2023-01-04T06:44:25.4291512Z linter.run_check(ctx) 2023-01-04T06:44:25.4292948Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pylama/lint/pylama_pydocstyle.py", line 33, in run_check 2023-01-04T06:44:25.4293855Z for err in PyDocChecker().check_source( 2023-01-04T06:44:25.4295040Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pydocstyle/checker.py", line 156, in check_source 2023-01-04T06:44:25.4296384Z error = this_check( 2023-01-04T06:44:25.4297679Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pydocstyle/checker.py", line 520, in check_imperative_mood 2023-01-04T06:44:25.4298578Z and not function.is_property(self.property_decorators) 2023-01-04T06:44:25.4299850Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pydocstyle/parser.py", line 222, in is_property 2023-01-04T06:44:25.4300565Z return any( 2023-01-04T06:44:25.4301637Z File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/pydocstyle/parser.py", line 223, in 2023-01-04T06:44:25.4302433Z decorator.name in property_decorator_names 2023-01-04T06:44:25.4303292Z TypeError: argument of type 'bool' is not iterable

sambhav commented 1 year ago

@urmich could you please provide a minimal test case to reproduce this error?.

I will need the configuration you are using and an example file where this error is raised.

I cannot reproduce this problem.

johannesjh commented 1 year ago

I am getting the same error in this CI job... both source code and CI script are publicly visible and may help analyzing the underlying problem.

In summary, it looks like I am experiencing the same problem, the problem occurs reproducably in a ci job... but I am finding it difficult to find the root cause.

sigmavirus24 commented 1 year ago

@urmich could you please provide a minimal test case to reproduce this error?.

I will need the configuration you are using and an example file where this error is raised.

I cannot reproduce this problem.

Note the OP here is using pydocstyle from pylama, not directly which is why you can't reproduce

sambhav commented 1 year ago

It seems the issue stems from the fact that pylama does not specify keywords for keyword arguments so it is passing a wrong value of False for property_decorators to check_source.

sambhav commented 1 year ago

This can potentially be fixed if we move https://github.com/PyCQA/pydocstyle/blob/bd294bbf6c80c578716e8817b5de79220ac9f089/src/pydocstyle/checker.py#L137 to be the last argument, but I would really prefer pylama to fix its usage instead.

sambhav commented 1 year ago

There seems to be an issue upstream already https://github.com/klen/pylama/issues/232

sambhav commented 1 year ago

Please follow up with pylama maintainers for a fix.