con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

Refactor File handling #103

Closed asmacdo closed 1 week ago

asmacdo commented 2 weeks ago

This PR centralizes all of the filepath formatting, checking for prior existence (adds clobber option), and creating new files.

This removes some complexity from many functions, and since it touchs a lot of the codebase the unittests required big changes.

Fixes: https://github.com/con/duct/issues/23

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.47%. Comparing base (411b77a) to head (64eedcf).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #103 +/- ## ========================================== + Coverage 89.10% 92.47% +3.37% ========================================== Files 2 2 Lines 312 319 +7 Branches 41 50 +9 ========================================== + Hits 278 295 +17 + Misses 28 18 -10 Partials 6 6 ```

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

asmacdo commented 1 week ago

@jwodder Could you review? I'm specifically interested in whether I abused the dataclass. Idiomatic nitpicks encouraged :)