dyc icon indicating copy to clipboard operation
dyc copied to clipboard

Coverage report

Open mboekhold opened this issue 5 years ago • 9 comments

It would be cool to have a feature where can search through a project's files and provide a coverage report of top, method and class doc strings.

mboekhold avatar May 09 '19 18:05 mboekhold

is this still open? can I pick this up if it is?

kmohan96214 avatar Sep 18 '19 06:09 kmohan96214

Hi, yes it is open :)

mboekhold avatar Sep 18 '19 06:09 mboekhold

@kmohan96214 were you going to work on this?

AvianAnalyst avatar Sep 26 '19 21:09 AvianAnalyst

Can I take this up? @mboekhold

Shanmugapriya03 avatar Oct 08 '19 10:10 Shanmugapriya03

Yes you can go ahead @Shanmugapriya03

mboekhold avatar Oct 08 '19 11:10 mboekhold

I found a package to implement docstring coverage https://pypi.org/project/docstr-coverage/ but I am wondering how can implement this in dyc

When I locally did a coverage test the output I got is :

(base) Priya:dyc shanmugapriyar$ docstr-coverage dyc/
File: "dyc/hooks.py"
 - No module docstring
 Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%

File: "dyc/methods.py"
 - No docstring for `MethodBuilder`
 - No docstring for `MethodFormatter`
 - No docstring for `MethodInterface`
 - No docstring for `MethodInterface.__init__`
 - No docstring for `ArgumentDetails`
 - No docstring for `ArgumentDetails.__init__`
 Needed: 29; Found: 23; Missing: 6; Coverage: 79.3%

File: "dyc/events.py"
 - No docstring for `WatchEvent`
 - No docstring for `Watcher`
 Needed: 5; Found: 3; Missing: 2; Coverage: 60.0%

File: "dyc/__init__.py"
 - File is empty
 Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%

File: "dyc/parser.py"
 - No docstring for `ParsedConfig`
 - No docstring for `ParsedConfig.__init__`
 Needed: 3; Found: 1; Missing: 2; Coverage: 33.3%

File: "dyc/utils.py"
 - No docstring for `BlankFormatter`
 - No docstring for `BlankFormatter.__init__`
 - No docstring for `BlankFormatter.get_value`
 Needed: 13; Found: 10; Missing: 3; Coverage: 76.9%

File: "dyc/dyc.py"
 Needed: 4; Found: 4; Missing: 0; Coverage: 100.0%

File: "dyc/exceptions.py"
 - No docstring for `DYCError`
 - No docstring for `SetupError`
 - No docstring for `UndefinedPattern`
 - No docstring for `ConfigurationMissing`
 - No docstring for `FormattingConfigurationHandler`
 - No docstring for `QuitConfirmEditor`
 - No docstring for `DYCConfigurationSetup`
 - No docstring for `OverrideConfigurations`
 Needed: 9; Found: 1; Missing: 8; Coverage: 11.1%

File: "dyc/diff.py"
 - No docstring for `DiffParser`
 - No docstring for `Diff`
 - No docstring for `Diff.__init__`
 Needed: 13; Found: 10; Missing: 3; Coverage: 76.9%

File: "dyc/main.py"
 - No docstring for `DYC`
 - No docstring for `DYC.__init__`
 Needed: 6; Found: 4; Missing: 2; Coverage: 66.7%

File: "dyc/base.py"
 - No docstring for `Builder`
 - No docstring for `Builder.__init__`
 - No docstring for `FilesDirector`
 - No docstring for `FormatsDirector`
 Needed: 19; Found: 15; Missing: 4; Coverage: 78.9%

File: "dyc/configs/__init__.py"
 - No module docstring
 - No docstring for `Config`
 Needed: 7; Found: 5; Missing: 2; Coverage: 71.4%


Overall statistics for 12 files (1 files are empty):
Docstrings needed: 109; Docstrings found: 76; Docstrings missing: 33
Total docstring coverage: 69.7%;  Grade: Good

Need inputs on implementing this here!

Shanmugapriya03 avatar Oct 08 '19 16:10 Shanmugapriya03

I found a package to implement docstring coverage https://pypi.org/project/docstr-coverage/ but I am wondering how can implement this in dyc

When I locally did a coverage test the output I got is :

(base) Priya:dyc shanmugapriyar$ docstr-coverage dyc/
File: "dyc/hooks.py"
 - No module docstring
 Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%

File: "dyc/methods.py"
 - No docstring for `MethodBuilder`
 - No docstring for `MethodFormatter`
 - No docstring for `MethodInterface`
 - No docstring for `MethodInterface.__init__`
 - No docstring for `ArgumentDetails`
 - No docstring for `ArgumentDetails.__init__`
 Needed: 29; Found: 23; Missing: 6; Coverage: 79.3%

File: "dyc/events.py"
 - No docstring for `WatchEvent`
 - No docstring for `Watcher`
 Needed: 5; Found: 3; Missing: 2; Coverage: 60.0%

File: "dyc/__init__.py"
 - File is empty
 Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%

File: "dyc/parser.py"
 - No docstring for `ParsedConfig`
 - No docstring for `ParsedConfig.__init__`
 Needed: 3; Found: 1; Missing: 2; Coverage: 33.3%

File: "dyc/utils.py"
 - No docstring for `BlankFormatter`
 - No docstring for `BlankFormatter.__init__`
 - No docstring for `BlankFormatter.get_value`
 Needed: 13; Found: 10; Missing: 3; Coverage: 76.9%

File: "dyc/dyc.py"
 Needed: 4; Found: 4; Missing: 0; Coverage: 100.0%

File: "dyc/exceptions.py"
 - No docstring for `DYCError`
 - No docstring for `SetupError`
 - No docstring for `UndefinedPattern`
 - No docstring for `ConfigurationMissing`
 - No docstring for `FormattingConfigurationHandler`
 - No docstring for `QuitConfirmEditor`
 - No docstring for `DYCConfigurationSetup`
 - No docstring for `OverrideConfigurations`
 Needed: 9; Found: 1; Missing: 8; Coverage: 11.1%

File: "dyc/diff.py"
 - No docstring for `DiffParser`
 - No docstring for `Diff`
 - No docstring for `Diff.__init__`
 Needed: 13; Found: 10; Missing: 3; Coverage: 76.9%

File: "dyc/main.py"
 - No docstring for `DYC`
 - No docstring for `DYC.__init__`
 Needed: 6; Found: 4; Missing: 2; Coverage: 66.7%

File: "dyc/base.py"
 - No docstring for `Builder`
 - No docstring for `Builder.__init__`
 - No docstring for `FilesDirector`
 - No docstring for `FormatsDirector`
 Needed: 19; Found: 15; Missing: 4; Coverage: 78.9%

File: "dyc/configs/__init__.py"
 - No module docstring
 - No docstring for `Config`
 Needed: 7; Found: 5; Missing: 2; Coverage: 71.4%


Overall statistics for 12 files (1 files are empty):
Docstrings needed: 109; Docstrings found: 76; Docstrings missing: 33
Total docstring coverage: 69.7%;  Grade: Good

Need inputs on implementing this here!

@mboekhold

Shanmugapriya03 avatar Oct 08 '19 16:10 Shanmugapriya03

Yes we should have something similar, we would want our own implementation to scan the files and give us some feedback on top doc strings, method docstrings and class docstrings

mboekhold avatar Oct 08 '19 16:10 mboekhold

Take a look at how the method docstrings are detected in methods.py, we sort of check if it is already documented, then prompt the method if it isn't, you can mock something similar as a start

mboekhold avatar Oct 08 '19 16:10 mboekhold