jeremiah-c-leary / vhdl-style-guide

Style guide enforcement for VHDL
GNU General Public License v3.0
182 stars 38 forks source link

Perform atomic write to files #1014

Closed alonbl closed 10 months ago

alonbl commented 11 months ago

Description Do not overwrite file as we may corrupt the file if something fails, instead write into temporary location and move the result into the final destination.

codecov[bot] commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (a35ff96) 95.87% compared to head (f7fe83c) 95.87%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1014 +/- ## ======================================= Coverage 95.87% 95.87% ======================================= Files 1500 1500 Lines 28273 28279 +6 ======================================= + Hits 27106 27112 +6 Misses 1167 1167 ``` | [Files](https://app.codecov.io/gh/jeremiah-c-leary/vhdl-style-guide/pull/1014?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeremiah+Leary) | Coverage Δ | | |---|---|---| | [vsg/apply\_rules.py](https://app.codecov.io/gh/jeremiah-c-leary/vhdl-style-guide/pull/1014?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeremiah+Leary#diff-dnNnL2FwcGx5X3J1bGVzLnB5) | `89.74% <100.00%> (+0.55%)` | :arrow_up: |

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

jeremiah-c-leary commented 10 months ago

Morning @alonbl ,

I can not think of any reason not to use a temp file and then copy it over.

So I imagine this pull request will be closed when we close #1017 , correct?

--Jeremy

alonbl commented 10 months ago

Morning @alonbl ,

I can not think of any reason not to use a temp file and then copy it over.

It is atomic move not copy, so either you have the new or the old.

So I imagine this pull request will be closed when we close #1017 , correct?

Correct, it is included in the combined patchset.

alonbl commented 10 months ago

Closed via #1017