Module::Checkstyle::Check::Package - Handles 'package' declarations
- Package naming
Checks that your package is named correctly. Use matches-name to declare a regular expression that must match.
matches-name = /^\w+(\:\:\w+)*$/
- Max packages in single file
Checks that you only declare a specified number of packages in a single source file. Use max-per-file to set the maximum number of
package-statements allowed. You usually want this to be set to 1.
max-per-file = 1
- Package declaration is first statement
Checks that the the first significantstatement in a file is a
package-declaration. Enable by setting package-comes-first to true. This test is only enabled if the parsed file ends with
is-first-statement = true
- Package in file matches filename
Checks that at least one package in the given file matches the name of the file. That is if the file is named lib/Module/Checkstyle.pm it must declare Module::Checkstyle as a package in the file. Enable by setting has-matching-filename to true.
has-matching-filename = true
Writing configuration files. "Format" in Module::Checkstyle::Config