Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Perl::Critic::Freenode to determine good coding style #1902

Merged
merged 2 commits into from Dec 3, 2018

Conversation

kraih
Copy link
Member

@kraih kraih commented Nov 30, 2018

This should be a well balanced set of rules to encourage a slightly better coding style. I've also fixed the dependency on JSON, which was missing from cpanfile, and removed the dependency on List::MoreUtils, which was unnecessary.

Progress: https://progress.opensuse.org/issues/44597.

@kraih
Copy link
Member Author

kraih commented Nov 30, 2018

Severity 4 (stern) is stricter than before, but still not very strict. You can check manually with perlcritic -1 lib to see all rules applied. I do suggest following all rules (and will do so myself), but enforcing them seems unrealistic for now. Maybe we can lower severity over time (next step would be 3 then).

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #1902 into master will decrease coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1902      +/-   ##
==========================================
- Coverage   90.56%   90.47%   -0.09%     
==========================================
  Files         148      148              
  Lines       10266    10369     +103     
==========================================
+ Hits         9297     9381      +84     
- Misses        969      988      +19
Impacted Files Coverage Δ
lib/OpenQA/Worker/Cache.pm 93.56% <ø> (-0.03%) ⬇️
lib/OpenQA/Schema/Result/Workers.pm 96.77% <100%> (ø) ⬆️
lib/OpenQA/WebAPI/Controller/LiveViewHandler.pm 92.2% <100%> (-3.88%) ⬇️
lib/OpenQA/Client/Archive.pm 81.66% <100%> (ø) ⬆️
lib/OpenQA.pm 69.23% <0%> (-2.57%) ⬇️
lib/OpenQA/Worker/Engines/isotovideo.pm 96.08% <0%> (-0.56%) ⬇️
lib/OpenQA/Utils.pm 91.92% <0%> (-0.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d6b8d6...6082894. Read the comment docs.

@Martchus
Copy link
Contributor

You need to add perl(Perl::Critic::Freenode) to t_requires in openQA.spec, too.

@kraih
Copy link
Member Author

kraih commented Nov 30, 2018

Also forgot to link to the actual rules that Perl::Critic::Freenode uses. They do mostly overlap with the high severity rules from core perlcritic, but some are not included, like BuiltinFunctions::ProhibitStringyEval (which has many valid uses and needs to be judged on a case by case basis).

Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite WIP tag it looks already good to merge.

@kraih
Copy link
Member Author

kraih commented Nov 30, 2018

@Martchus Haha, and just as you say that the random cache service bug you were hunting hits.

    #   Failed test 'job enqueued'
    #   at ./t/25-cache-service.t line 442.
    # Looks like you failed 1 test of 2.
#   Failed test 'Test Minion task registration and execution'
#   at ./t/25-cache-service.t line 448.
Can't call method "execute" on an undefined value at ./t/25-cache-service.t line 443.

Not restarting the Travis job yet in case you want to look at the result first.

@Martchus
Copy link
Contributor

Good, I'll have a look.

@kraih kraih changed the title WIP: Use Perl::Critic::Freenode to determine good coding style Use Perl::Critic::Freenode to determine good coding style Dec 3, 2018
@kraih kraih merged commit 359b5dd into os-autoinst:master Dec 3, 2018
coolo pushed a commit that referenced this pull request Dec 3, 2018
commit 359b5dd
Merge: 70b7b06 6082894
Author:     Sebastian Riedel <kraihx@gmail.com>
AuthorDate: Mon Dec 3 10:43:49 2018 +0100
Commit:     GitHub <noreply@github.com>
CommitDate: Mon Dec 3 10:43:49 2018 +0100

    Merge pull request #1902 from kraih/stricter_perl_critic

    Use Perl::Critic::Freenode to determine good coding style
@kraih kraih deleted the stricter_perl_critic branch May 12, 2020 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants