SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

Switch README extraction to use output directory path names #401

Closed WilliamsCJ closed 1 year ago

WilliamsCJ commented 1 year ago

Currently the README extraction feature uses the path of README files in the input directory as keys in the generated JSON. This is inconsistent with the rest of the JSON, as directory paths are given relative to the output directory.

This pull request changes the paths of extracted README files to use the output directory path and ammends relevant unit test.

Example

Consider a repository with a README.md file at the root. Previously, calling inspect4py -i ../repo -o out -rm would extract the README with the path ../repo/README.md in the JSON. This fix corrects the output to out/repo/README.md.

dgarijo commented 1 year ago

Thanks, looks good on my end (except for that print(f) command, which could be deleted). I will let @rosafilgueira have a look

WilliamsCJ commented 1 year ago

Thanks, looks good on my end (except for that print(f) command, which could be deleted). I will let @rosafilgueira have a look

Thanks for spotting! I've removed those in 61677699a24adf8ba0fc51ee85125dbcd84185d8.