Open aemonge opened 2 months ago
Hi @aemonge , could you explain what you meant by "header extra info"? Maybe an example would help. Thanks!
Sure :)
Given a file like:
❯ cat a.py
def missing_doc(a: int, b: int = 2) -> int:
"""
Missing doc
Parameters
----------
a : dict
Azucar
b : int, optional
[default=2] Baron
Returns
-------
int
"""
return a + b
The current implemention outputs:
❯ pydoclint -q a.py
Loading config from user-specified .toml file: pyproject.toml
Found options defined in pyproject.toml:
{'style': 'numpy', 'exclude': '\\.git|\\.tox|tests|data', 'require_return_section_when_returning_
nothing': True, 'require_yield_section_when_yielding_nothing': False, 'treat_property_methods_as_
class_attributes': True, 'skip_checking_short_docstrings': False}
a.py
1: DOC105: Function `missing_doc`: Argument names match, but type hints in these args do not
match: a
And I expect a even more quiet version:
❯ pydoclint -q a.py
a.py
1: DOC105: Function `missing_doc`: Argument names match, but type hints in these args do not
match: a
So, --info
would be the configuation and and config path, shown as "header":
❯ pydoclint -q a.py
Loading config from user-specified .toml file: pyproject.toml
Found options defined in pyproject.toml:
{'style': 'numpy', 'exclude': '\\.git|\\.tox|tests|data', 'require_return_section_when_returning_
nothing': True, 'require_yield_section_when_yielding_nothing': False, 'treat_property_methods_as_
class_attributes': True, 'skip_checking_short_docstrings': False}
So the messages come from these two lines:
and
I need to further learn how click
passes config options. If you happen to be familiar with click
, any help is welcome!
I'll give a shot next week, I'm familiar with click. So for sure I'll archive it, just need some spare time :wink:
I've done the happy path work -> https://github.com/jsh9/pydoclint/pull/178
The test are passing, checked using tox
.
I didn't create a new test, since it needs to check for STDOUT and that a bit difficult to handle, if you need it I'll take my time and do it for you <3
Finally, I couldn't create a smoke test, since I don't know how to run the project locally (I'm more of a poetry dev, rather than a tox one). I've read the notes_for_developers.md but couldn't find a command to run this on ltye playground.py, if you can tell me how it would be lovely.
To be able to integrate this on null-ls ( now none-ls ) as a editor diagnostics, we need to remove the header extra info.
I've "by-passed" it by wrapping it in:
But would be great to only show header (config info) if asked
--info