Fix externalInfoURLs in rulesets
This commit is contained in:
@ -16,6 +16,12 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<!-- this needs to run before the ant task -->
|
<!-- this needs to run before the ant task -->
|
||||||
|
@ -10,11 +10,11 @@ Rules which enforce generally accepted best practices.
|
|||||||
</description>
|
</description>
|
||||||
|
|
||||||
<rule name="ProhibitedInterfaceBuilder"
|
<rule name="ProhibitedInterfaceBuilder"
|
||||||
since="7.0"
|
since="7.0.0"
|
||||||
language="swift"
|
language="swift"
|
||||||
message="Creating views using Interface Builder should be avoided."
|
message="Creating views using Interface Builder should be avoided."
|
||||||
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
||||||
externalInfoUrl="http://pmd.github.io/pmd/pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder">
|
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder">
|
||||||
<description>
|
<description>
|
||||||
Creating views using Interface Builder should be avoided.
|
Creating views using Interface Builder should be avoided.
|
||||||
Defining views by code allows the compiler to detect issues that otherwise will be runtime errors.
|
Defining views by code allows the compiler to detect issues that otherwise will be runtime errors.
|
||||||
@ -45,11 +45,11 @@ class ViewController: UIViewController {
|
|||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule name="UnavailableFunction"
|
<rule name="UnavailableFunction"
|
||||||
since="7.0"
|
since="7.0.0"
|
||||||
language="swift"
|
language="swift"
|
||||||
message="Unimplemented functions should be marked as unavailable."
|
message="Unimplemented functions should be marked as unavailable."
|
||||||
class="net.sourceforge.pmd.lang.swift.rule.bestpractices.UnavailableFunctionRule"
|
class="net.sourceforge.pmd.lang.swift.rule.bestpractices.UnavailableFunctionRule"
|
||||||
externalInfoUrl="http://pmd.github.io/pmd/pmd_rules_swift_bestpractices.html#unavailablefunction">
|
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_bestpractices.html#unavailablefunction">
|
||||||
<description>
|
<description>
|
||||||
Due to Objective-C and Swift interoperability some functions are often required to be implemented but
|
Due to Objective-C and Swift interoperability some functions are often required to be implemented but
|
||||||
aren't really needed. It is extremely common that the sole implementation of the functions consist of throwing
|
aren't really needed. It is extremely common that the sole implementation of the functions consist of throwing
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
<rule name="ForceCast"
|
<rule name="ForceCast"
|
||||||
language="swift"
|
language="swift"
|
||||||
since="7.0"
|
since="7.0.0"
|
||||||
message="Force casts should be avoided."
|
message="Force casts should be avoided."
|
||||||
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
||||||
externalInfoUrl="http://pmd.github.io/pmd/pmd_rules_swift_errorprone.html#forcecast">
|
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_errorprone.html#forcecast">
|
||||||
<description>
|
<description>
|
||||||
Force casts should be avoided. This may lead to a crash if it's not used carefully.
|
Force casts should be avoided. This may lead to a crash if it's not used carefully.
|
||||||
For example assuming a JSON property has a given type, or your reused Cell has a certain contract.
|
For example assuming a JSON property has a given type, or your reused Cell has a certain contract.
|
||||||
@ -41,10 +41,10 @@ NSNumber() as? Int // no violation
|
|||||||
|
|
||||||
<rule name="ForceTry"
|
<rule name="ForceTry"
|
||||||
language="swift"
|
language="swift"
|
||||||
since="7.0"
|
since="7.0.0"
|
||||||
message="Force tries should be avoided."
|
message="Force tries should be avoided."
|
||||||
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
class="net.sourceforge.pmd.lang.rule.XPathRule"
|
||||||
externalInfoUrl="http://pmd.github.io/pmd/pmd_rules_swift_errorprone.html#forcetry">
|
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_errorprone.html#forcetry">
|
||||||
<description>
|
<description>
|
||||||
Force tries should be avoided. If the code being wrapped happens to raise and exception, our application will crash.
|
Force tries should be avoided. If the code being wrapped happens to raise and exception, our application will crash.
|
||||||
Consider using a conditional try and handling the resulting optional, or wrapping the try statement in a do-catch block.
|
Consider using a conditional try and handling the resulting optional, or wrapping the try statement in a do-catch block.
|
||||||
|
@ -147,7 +147,7 @@ public abstract class AbstractRuleSetFactoryTest {
|
|||||||
.append(rule.getName())
|
.append(rule.getName())
|
||||||
.append(" is missing 'externalInfoURL' attribute\n");
|
.append(" is missing 'externalInfoURL' attribute\n");
|
||||||
} else {
|
} else {
|
||||||
String expectedExternalInfoURL = "https?://pmd.(sourceforge.net|github.io)/.+/pmd_rules_"
|
String expectedExternalInfoURL = "https://docs.pmd-code.org/.+/pmd_rules_"
|
||||||
+ language.getTerseName() + "_"
|
+ language.getTerseName() + "_"
|
||||||
+ IOUtil.getFilenameBase(fileName)
|
+ IOUtil.getFilenameBase(fileName)
|
||||||
+ ".html#"
|
+ ".html#"
|
||||||
|
Reference in New Issue
Block a user