ericphanson / ExplicitImports.jl

Developer tooling for Julia namespace management: detecting implicit imports, improper explicit imports, and improper qualified accesses
https://ericphanson.github.io/ExplicitImports.jl/
MIT License
62 stars 2 forks source link

WIP: add `improper_explicit_imports` that handles non-public and non-owner explicit imports, and add non-public results to `improper_qualified_accesses` #28

Closed ericphanson closed 2 weeks ago

ericphanson commented 3 months ago

improper_explicit_imports is the analog to improper_qualified_accesses and subsumes stale_explicit_imports. This leads to:

Problem Example Interactive usage Programmatic API access Regression-testing check
Implicit imports using LinearAlgebra print_explicit_imports implicit_imports check_no_implicit_imports
Non-owning import using LinearAlgebra: map print_explicit_imports improper_explicit_imports TODO: check_all_explicit_imports_via_owners
Non-public import using LinearAlgebra: _svd! print_explicit_imports with report_non_public=true improper_explicit_imports TODO: check_all_explicit_imports_public
Stale import using LinearAlgebra: svd # unused print_explicit_imports improper_explicit_imports check_no_stale_explicit_imports
Non-owning access LinearAlgebra.map print_explicit_imports improper_qualified_accesses check_all_qualified_accesses_via_owners
Non-public access LinearAlgebra._svd! print_explicit_imports with report_non_public=true improper_qualified_accesses TODO: check_all_qualified_accesses_public

which I think is getting close to comprehensive in terms of detecting issues in this space. I also want to only have 1 interactive printing function rather than 1 per thing. However I think the check_ functions should be quite granular, since different people want to test for different things, and I consider it breaking to add new checks to existing check_ functions since tests will start failing.

So after this, we will have 1 interactive printing function, 3 API functions (implicit imports / improper explicit imports / improper qualified accesses), and 6 check_ functions. The printing functions and API functions can get more outputs as time goes on in a non-breaking way, while the check_ functions can't check for more things as times go on, and we just add more checks.

closes #52 closes #6

TODO-

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 90.45643% with 23 lines in your changes missing coverage. Please review.

Project coverage is 93.65%. Comparing base (d46bc8e) to head (20526a7). Report is 2 commits behind head on main.

Files Patch % Lines
src/interactive_usage.jl 86.20% 12 Missing :warning:
src/deprecated.jl 90.00% 4 Missing :warning:
src/get_names_used.jl 87.09% 4 Missing :warning:
src/ExplicitImports.jl 50.00% 1 Missing :warning:
src/improper_explicit_imports.jl 97.91% 1 Missing :warning:
src/improper_qualified_accesses.jl 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #28 +/- ## ========================================== - Coverage 96.47% 93.65% -2.82% ========================================== Files 5 9 +4 Lines 680 882 +202 ========================================== + Hits 656 826 +170 - Misses 24 56 +32 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.