sot / starcheck

BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Apply perltidy to starcheck #405

Closed taldcroft closed 1 year ago

taldcroft commented 1 year ago

Description

I did this: find . -name '*.p[ml]' | xargs perltidy -b -pt=2 -mft=1 -l 88 --no-valign

Interestingly, even though (in fine Perl form) perltidy has a bazillion formatting options, they really want to vertically align all the => in a hash or = in subsequent assignments. I discovered at https://stackoverflow.com/questions/4538209 that there is an undocumented --no-valign option.

Maybe the Perl style is to do all that vertical alignment, but to me it just looks old.

For the record, I installed perltidy in a dev ska env with cpanm Perl::Tidy and this worked just fine.

Interface impacts

None

Testing

Functional tests

Just regression.

Ran the standard starcheck set and saw no diffs. Ran the set we used for #402 in

https://icxc.cfa.harvard.edu/aspect/test_review_outputs/starcheck-pr405/

and see no diffs.

# Long week and IR Zone holds
starcheck -dir /data/mpcrit1/mplogs/2022/DEC2622/oflsa -out dec2622a_flight
/home/jeanconn/git/starcheck/sandbox_starcheck -dir /data/mpcrit1/mplogs/2022/DEC2622/oflsa -out dec2622a_test
/proj/sot/ska/bin/diff2html dec2622a_flight.txt dec2622a_test.txt > dec2622a_diff.html

# Monitor star
starcheck -dir /data/mpcrit1/mplogs/2022/NOV2822/oflsa -out nov2822a_flight
/home/jeanconn/git/starcheck/sandbox_starcheck -dir /data/mpcrit1/mplogs/2022/NOV2822/oflsa -out nov2822a_test
/proj/sot/ska/bin/diff2html nov2822a_flight.txt nov2822a_test.txt > nov2822a_diff.html

# Maneuver only loads
starcheck -dir /data/mpcrit1/mplogs/2022/OCT2422/oflsb -out oct2422b_flight
/home/jeanconn/git/starcheck/sandbox_starcheck -dir /data/mpcrit1/mplogs/2022/OCT2422/oflsb -out oct2422b_test
/proj/sot/ska/bin/diff2html oct2422b_flight.txt oct2422b_test.txt > oct2422b_diff.html

# Replan
starcheck -dir /data/mpcrit1/mplogs/2021/MAY0521/oflsa -out may0521a_flight
/home/jeanconn/git/starcheck/sandbox_starcheck -dir /data/mpcrit1/mplogs/2021/MAY0521/oflsa -out may0521a_test
/proj/sot/ska/bin/diff2html may0521a_flight.txt may0521a_test.txt > may0521a_diff.html
jeanconn commented 1 year ago

(I suppose I should have approved conditional on confirmation this actually runs (and basically does not apply any code changes), but I had some confidence in perltidy in that regard.)

taldcroft commented 1 year ago

I'm not sure what guarantees are provided by perltidy about code correctness, but presumably it is just munging whitespace that isn't significant in perl.

@jeanconn - I'll run the list of regression loads from #402 and confirm no unexpected diffs and document that prior to merge.