Pattern: Malformed file header
Issue: -
A lot of projects require a header with a copyright notice, or they require a license in each file. This does a simple text comparison between the header and the first lines of the file. You can have multiple lines, but make sure you surround the text with a CDATA
section. You can also specify a regular expression, as long as you set the regex parameter to true.
Name | Description | Type | Default Value |
---|---|---|---|
header | Header | string |
<check enabled="true" class="org.scalastyle.file.HeaderMatchesChecker" level="warning">
<parameters>
<parameter name="regex">false</parameter>
<parameter name="header">// Copyright \(C\) 2011-2012 the original author or authors.</parameter>
</parameters>
</check>
or
<check enabled="true" class="org.scalastyle.file.HeaderMatchesChecker" level="warning">
<parameters>
<parameter name="regex">true</parameter>
<parameter name="header">// Copyright \(C\) (?:\d{4}-)?\d{4} the original author or authors.</parameter>
</parameters>
</check>