How to use CodePolicy?

Moderator: crythias

Post Reply
edi
Znuny newbie
Posts: 17
Joined: 20 Nov 2018, 16:10
Znuny Version: OTRS 4
Real Name: Eduard
Location: Russia
Contact:

How to use CodePolicy?

Post by edi »

Now I'm migrating from OTRS 4 to OTRS 6.
I have several own modules.
I rewrote them for OTRS 6 and I decided to check them using CodePolicy

Well, I check my module
./bin/otrs.CodePolicy.pl -f Kernel/System/Image.pm
and get the output:

Found OTRS version 6.0
This module seems to be copyrighted by xxx. file copyright will auomatically be assigned to xxx.
If this is not correct, you can change the <Vendor> tag in your SOPM.
[checked] Kernel/System/Image.pm
TidyAll::Plugin::OTRS::Legal::LicenseValidator
Found no valid license header! at /home/edi/sources/otrs-6_0/Kernel/TidyAll/Plugin/OTRS/Legal/LicenseValidator.pm line 291.
1 file did not pass tidyall check

I don't understand what this means and how I can set a valid license header.
Or maybe there is a way to disable license verification?
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: How to use CodePolicy?

Post by zzz »

Hello Eduard,

You don't have to use CodePolicy at all.
If your code is working on the newest version, the migration is done.

That module is mainly used within the xxx to get sure that the style guide is observed by the developers who commit changes to the source code.

It's only useful if you're planing to make a pull request or want to make sure that your code is pretty (use PerlTidy in that case).
But chances are close to none that the xxx will check or accept your pull request unless it's a typo or minor change; so don't even waste your time with that.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
edi
Znuny newbie
Posts: 17
Joined: 20 Nov 2018, 16:10
Znuny Version: OTRS 4
Real Name: Eduard
Location: Russia
Contact:

Re: How to use CodePolicy?

Post by edi »

Hello Emin, thanks you for your reply.

The fact is that the modules that we use were written at different times by different programmers.
Thus, the code does not have a uniform style, but I want it to be.
And since some modules still need to be rewritten, now is the best time to introduce a unified style into development.
So I think that using CodePolicy is a great solution to achieve this.
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: How to use CodePolicy?

Post by zzz »

Oh I see. That would actually make sense.

The error is most likely referring to a missing <Vendor> and <License> Tag in your .sopm file.
Check this one for example: https://github.com/OTRS/OTRSMasterSlave ... ve.sopm#L6

Did you even create a .opm file to bundle all your custom changes?

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
Post Reply