A commen error when running tools/tidy
in the openSUSE/SLES tests repository for openQA is the following error:
Wrong version of perltidy. Found '20211027', expected '20211029'.
This indicated a mismatch of the found vs. expected version of perltidy and the tidy script aborts to avoid inconsistent formatting between your PR and the CI pipeline. In Perl this is unfortunately necessary, as often a new version of perltidy
formats the code differently. Yes, this is a source of constant struggle and one of the reasons why I dislike Perl (sorry for the mild rant).
My solution
I simply just yeet the new version and be done with it:
cpanm Perl::Tidy@20211029
What is tools/tidy
?
tools/tidy
is a handy tool that re-formats all modified perl files in the os-autoinst-distri-opensuse repository. This is not only a good habit to do but also necessary before creating a pull request, as otherwise the CI pipeline would fail.
Another handy tools is make test-static
that runs a set of static tests to avoid common issues before creating pull requests.