diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index cd7697bdbf..9f008e7e3f 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -16,6 +16,12 @@ + + + ${project.basedir}/src/main/resources + true + + diff --git a/pmd-swift/src/main/resources/category/swift/bestpractices.xml b/pmd-swift/src/main/resources/category/swift/bestpractices.xml index 6bf75958e6..cab248b276 100644 --- a/pmd-swift/src/main/resources/category/swift/bestpractices.xml +++ b/pmd-swift/src/main/resources/category/swift/bestpractices.xml @@ -10,11 +10,11 @@ Rules which enforce generally accepted best practices. + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_bestpractices.html#prohibitedinterfacebuilder"> Creating views using Interface Builder should be avoided. Defining views by code allows the compiler to detect issues that otherwise will be runtime errors. @@ -45,11 +45,11 @@ class ViewController: UIViewController { + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_bestpractices.html#unavailablefunction"> 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 diff --git a/pmd-swift/src/main/resources/category/swift/errorprone.xml b/pmd-swift/src/main/resources/category/swift/errorprone.xml index 1a64a50b85..e4dab5022d 100644 --- a/pmd-swift/src/main/resources/category/swift/errorprone.xml +++ b/pmd-swift/src/main/resources/category/swift/errorprone.xml @@ -11,10 +11,10 @@ + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_errorprone.html#forcecast"> 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. @@ -41,10 +41,10 @@ NSNumber() as? Int // no violation + externalInfoUrl="${pmd.website.baseurl}/pmd_rules_swift_errorprone.html#forcetry"> 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. diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java index 372e55b422..c4f8c22a46 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java @@ -147,7 +147,7 @@ public abstract class AbstractRuleSetFactoryTest { .append(rule.getName()) .append(" is missing 'externalInfoURL' attribute\n"); } else { - String expectedExternalInfoURL = "https?://pmd.(sourceforge.net|github.io)/.+/pmd_rules_" + String expectedExternalInfoURL = "https://docs.pmd-code.org/.+/pmd_rules_" + language.getTerseName() + "_" + IOUtil.getFilenameBase(fileName) + ".html#"