Sei sulla pagina 1di 14

Documentation

OTRSCodePolicy
OTRS code quality checks. Version 1.0.7 Edition

Build Date:
2014-09-13

Table of Contents
Preface ................................................................................................................................ iii
1. Feature List ..................................................................................................................... 1
1. How it can be used ................................................................................................. 1
2. What's cool about it ................................................................................................ 1
3. How to run it to validate your code ........................................................................ 1
4. How to configure it .................................................................................................. 1
2. System Requirements ..................................................................................................... 2
1. Framework ............................................................................................................... 2
2. Packages .................................................................................................................. 2
3. Operating System .................................................................................................... 2
4. Third Party Software ................................................................................................ 2
3. Installation ....................................................................................................................... 3
1. Admin Interface ....................................................................................................... 3
2. Command Line ........................................................................................................ 3
4. Configuration ................................................................................................................... 4
5. Filelist .............................................................................................................................. 5
6. ChangeLog .................................................................................................................... 10
7. Contacts ........................................................................................................................ 11
1. OTRS AG ................................................................................................................ 11

ii

Preface
OTRSCodePolicy is a general code quality checker that can also make changes to the code.
You can use it to check your code against the OTRS code style guide.

iii

Chapter1.Feature List
1.How it can be used
manually (see below)
as a pre commit hook that validates your local changes
as a pre receive filter that checks what you push to git.otrs.org
as a unit test that you can run locally and also runs on the UT servers (for the framework)

2.What's cool about it


modular, easy to extend and configure
single point of contact for all code quality issues
already runs on the UT servers to maintain code quality in the framework continuously
automatically detects the framework version, code checks can run conditionally - this
means we can make it stricter for future versions of OTRS - also should not complain about
code in packages for older OTRS versions too much
You can disable single filters directly in your code instead of in a huge configuration file
with tons of exceptions.

3.How to run it to validate your code


manually: call /path/to/OTRSCodePolicy/bin/otrs.CodePolicy.pl from the toplevel of your
repository. Checks changed files (no arguments), all files (--all), a directory (--directory) or
a file (--file).
pre commit hook: call /path/to/OTRSCodePolicy/scripts/install-git-hooks.pl in every local
repository that you want to have the pre commit hook. It will automatically be run by "git
commit" and reject your commit if a problem was found. Skip with "git commit --no-verify".
UnitTest: install package into OTRS, then run bin/otrs.UnitTest.pl.

4.How to configure it
Configuration is done in TidyAll/tidyallrc. This file contains only directory-level configuration, no exceptions for single customized files or modules.
If you need to make an exception in a file for a certain filter, you can use this syntax:
nofilter(Name::Of::Filter).
Example Perl:
## nofilter(TidyAll::Plugin::OTRS::Perl::ISA)
Example SOPM:
<!-- nofilter(TidyAll::Plugin::OTRS::SOPM::DocumentationPresent) -->

Some of the checks are implemented as Perl::Critic policies. To disable these individually,
you can place "## no critic" marks as it is usual for Perl::Critic.

Chapter2.System Requirements
1.Framework
The following OTRS framework is required:
4.0.x
3.3.x
3.2.x
3.1.x

2.Packages
The following packages are required:
None

3.Operating System
This package requires one of the following operating systems:
None

4.Third Party Software


This third party software is required to use this package:
xmllint (often in the libxml2-utils package)

Chapter3.Installation
The following instructions explain how to install the package.

1.Admin Interface
Please use the following URL to install the package utilizing the admin interface (please note
that you need to be in the admin group).
http://localhost/otrs/index.pl?Action=AdminPackageManager

2.Command Line
Whenever you cannot use the Admin Interface for whatever reason, you may use the following command line tool ("bin/otrs.PackageManager.pl") instead.
shell> bin/otrs.PackageManager.pl

-a install -p /path/to/OTRSCodePolicy-1.0.7.opm

Chapter4.Configuration
This package does not need to be configured.

Chapter5.Filelist
This list shows all included files and the referring permissions.
(755) bin/otrs.CodePolicy.pl
(644) Kernel/cpan-lib/Pod/Strip.pm
(644) Kernel/cpan-lib/Locale/PO.pm
(644) Kernel/TidyAll/OTRS.pm
(644) Kernel/TidyAll/OTRS/Git/PreCommit.pm
(644) Kernel/TidyAll/OTRS/Git/PreReceive.pm
(644) Kernel/TidyAll/Plugin/OTRS/Base.pm
(644) Kernel/TidyAll/Plugin/OTRS/Common/CustomizationMarkers.pm
(644) Kernel/TidyAll/Plugin/OTRS/Common/HeaderlineFilename.pm
(644) Kernel/TidyAll/Plugin/OTRS/Common/RemoveCVSIDs.pm
(644) Kernel/TidyAll/Plugin/OTRS/DTL/Baselink.pm
(644) Kernel/TidyAll/Plugin/OTRS/DTL/CGIHandle.pm
(644) Kernel/TidyAll/Plugin/OTRS/DTL/Format.pm
(644) Kernel/TidyAll/Plugin/OTRS/DTL/LQData.pm
(644) Kernel/TidyAll/Plugin/OTRS/DTL/Select.pm
(644) Kernel/TidyAll/Plugin/OTRS/DTL/UniqueBlock.pm
(644) Kernel/TidyAll/Plugin/OTRS/JavaScript/DebugCode.pm
(644) Kernel/TidyAll/Plugin/OTRS/Legal/AGPLValidator.pm
(644) Kernel/TidyAll/Plugin/OTRS/Legal/ReplaceCopyright.pm
(644) Kernel/TidyAll/Plugin/OTRS/Legal/SOPMLicense.pm
(644) Kernel/TidyAll/Plugin/OTRS/Migrations/3_4/FontAwesome.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/ProhibitLowPrecendeceOps.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/ProhibitSmartMatchOperator.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/ProhibitOpen.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/ProhibitUnless.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/RequireCamelCase.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/RequireLabels.pm
5

(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/RequireParensWithMethods.pm
(644)
Kernel/TidyAll/Plugin/OTRS/Perl/Critic/Policy/OTRS/
RequireTrueReturnValueForModules.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Critic/PolicyOTRS.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/CacheNew.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/DBObject.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/DieExit.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Dumper.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ForeachToFor.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ForMy.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Goto.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ISA.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/LayoutObject.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ModuleFormat.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ObjectDependencies.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ObjectNameSpace.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ParamObject.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/PerlCritic.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/PerlTidy.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/PodChecker.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/PodNewDoc.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/PodSpelling.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Print.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Require.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/ScriptFormat.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/SortKeys.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/SubDeclaration.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/SyntaxCheck.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/Time.pm
(644) Kernel/TidyAll/Plugin/OTRS/Perl/TranslationEncoding.pm
6

(644) Kernel/TidyAll/Plugin/OTRS/Perl/UseWarnings.pm
(644) Kernel/TidyAll/Plugin/OTRS/PO/Lint.pm
(644) Kernel/TidyAll/Plugin/OTRS/PO/msgfmt.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/CodeTags.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/DocumentationPresent.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/FileList.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/FileRights.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/Name.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/PackageRequired.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/RequiredElements.pm
(644) Kernel/TidyAll/Plugin/OTRS/SOPM/XSDValidator.pm
(644) Kernel/TidyAll/Plugin/OTRS/SQL/ColumnTypes.pm
(644) Kernel/TidyAll/Plugin/OTRS/SQL/ReservedWords.pm
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Configuration.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Database.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/calstblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/dbhierx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/dbnotnx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/dbpoolx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/docbook.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/htmltblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_2/xml.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_3/calstblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_3/dbhierx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_3/dbnotnx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_3/dbpoolx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_3/docbook.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/calstblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/dbhierx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/dbnotnx.xsd
7

(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/dbpoolx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/docbook.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/htmltblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_4/xml.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/calstblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/dbhierx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/dbnotnx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/dbpoolx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/docbook.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/htmltblx.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/Docbook/4_5/xml.xsd
(644) Kernel/TidyAll/Plugin/OTRS/StaticFiles/XSD/SOPM.xsd
(644) Kernel/TidyAll/Plugin/OTRS/TT/Format.pm
(644) Kernel/TidyAll/Plugin/OTRS/Whitespace/FourSpaces.pm
(644) Kernel/TidyAll/Plugin/OTRS/Whitespace/Tabs.pm
(644) Kernel/TidyAll/Plugin/OTRS/Whitespace/TrailingWhitespace.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/ConfigDescription.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/ConfigSyntax.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/Configuration/XSDValidator.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/Configuration/OutputFilterPre.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/Database/XSDValidator.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/Docbook/XSDValidator.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/Lint.pm
(644) Kernel/TidyAll/Plugin/OTRS/XML/LintWithOurParsers.pm
(644) Kernel/TidyAll/tidyallrc
(755) Kernel/TidyAll/git-hooks/pre-commit.pl
(755) Kernel/TidyAll/git-hooks/pre-receive.pl
(755) Kernel/TidyAll/git-hooks/prepare-commit-msg.pl
(755) scripts/install-git-hooks.pl
(755) scripts/uninstall-git-hooks.pl
8

(644) scripts/test/OTRSCodePolicyPlugins.pm
(644) scripts/test/OTRSCodePolicyPlugins/Common/HeaderlineFilename.t
(644) scripts/test/OTRSCodePolicy.t
(644) scripts/test/OTRSCodePolicyPlugins/Perl/CacheNew.t
(644) scripts/test/OTRSCodePolicyPlugins/Perl/ObjectDependencies.t
(644) scripts/test/OTRSCodePolicyPlugins/PerlCritic/ProhibitOpen.t
(644) scripts/test/OTRSCodePolicyPlugins/PerlCritic/RequireLabels.t
(644) scripts/test/OTRSCodePolicyPlugins/PO/Lint.t
(644) scripts/test/OTRSCodePolicyPlugins/SOPM/CodeTags.t
(644) scripts/test/OTRSCodePolicyPlugins/XML/Configuration/OutputFilterPre.t

Chapter6.ChangeLog
1.0.7 / 2014-09-13 15:48:24
Many bug fixes and improvements.

1.0.6 / 2014-06-16 16:20:12


Fixed XSD error.

1.0.5 / 2014-06-16 15:04:52


Many bug fixes and improvements.

1.0.4 / 2014-01-28 11:00:59


Corrected path in documentation.

1.0.3 / 2014-01-28 10:57:54


Changed directory structure to avoid creating toplevel directories.

1.0.2 / 2014-01-27 10:19:52


Package current state of module.

1.0.1 / 2013-10-24 17:30:03


First version.

10

Chapter7.Contacts
People who are involved in this implementation.

1.OTRS AG
Accounting: Rene Bakker <sales@otrs.com>, Phone +49 (0)6172 681988 0
Technical: Manuel Hecht <dev-support@otrs.com>, Phone +49 (0)6172 681988 0

11

Potrebbero piacerti anche