15463 Commits

Author SHA1 Message Date
Andreas Dangel
79fa9d2137 Merge branch 'pr-2083'
[core] Enable type resolution by default for XPath rules
2019-10-29 19:42:58 +01:00
Andreas Dangel
6e92282e24 Merge branch 'pr-2086'
[core] Improve logging of deprecated/renamed rules and non-existing excluded rules
2019-10-29 19:40:17 +01:00
Clément Fournier
34455b3051 Merge branch 'pr-2066' 2019-10-29 16:38:42 +01:00
Andreas Dangel
fc8f9b1c6e [doc] Clarify note about deprecated rules when referencing a complete ruleset 2019-10-28 21:46:39 +01:00
Andreas Dangel
fda81bd7bc [core] Don't enable deprecated rules if whole ruleset is imported
This restores the previous behavior.
2019-10-28 21:44:46 +01:00
Andreas Dangel
f9d7b0891b Merge branch 'pr-2027'
[doc,ci] Rework doc generation and release notes
2019-10-28 19:39:39 +01:00
Andreas Dangel
0a94dec8f0 Merge branch 'pr-2044'
[core] Wrong deprecation warnings for unused XPath attributes
2019-10-28 19:27:52 +01:00
Andreas Dangel
2d4b01dca2 Upgrade embedded pmd-designer to 6.19.0
Also fix integration test with the additional
language "text".
2019-10-27 19:02:03 +01:00
Andreas Dangel
078863e36e [core] Only log if a language doesn't provide categories.properties
The new pmd-designer 6.19.0 adds the language module "text" (PlainText).
It is used as a fallback, if no other language modules are on the
classpath.

With this change PMD only logs a warning
if the file categories.properties couldn't be found for a language
instead of throwing RuleSetNotFoundException.
2019-10-27 19:01:42 +01:00
Andreas Dangel
95bbf56aea Use released pmd-build-tools version 5 2019-10-27 12:05:13 +01:00
Andreas Dangel
7e19b97e15 [doc] Update release notes, fixes #1978, fixes #2082 2019-10-27 11:40:37 +01:00
Andreas Dangel
b1adf5c97c [doc] Add note for referencing a complete category or ruleset 2019-10-27 11:28:13 +01:00
Andreas Dangel
3c32f229f6 [core] Don't fail hard anymore if excluded rule doesn't exist
Fixes #1978
2019-10-27 10:16:17 +01:00
Andreas Dangel
9019f15cab [core] Improve logging of deprecated rule usages
Refs #2082

Not all cases are solved yet. It works, if a rule has been renamed
within the same category. If a rule is moved between categories,
then we might get multiple deprecation warnings.

There is also one important change when referencing a complete ruleset:
Previously we skipped all rules, that were deprecated without
distinguishing between rule definitions and rule references.
Now we only skip deprecated rule references but we still use
deprecated rule definitions. This affects any user, that simply uses
a "bulk-import" of category rulesets, because now, they'll also
use deprecated rules and get a warning. They'd need to exclude these
rules explicitly (or import just the rules they want to use).
2019-10-27 09:58:43 +01:00
Andreas Dangel
92b8af8477 [core] Enable type resolution by default for XPath rules
Fixes #2048

All XPath rules will have now type resolution enabled by default.
While this change is in core, it actually only affects Java, since
this is the only language which has a type resolution facade
registered in its language handler.
2019-10-26 16:58:07 +02:00
Andreas Dangel
752e5f8ad5 [java] Deprecate AbstractJavaRule#getDeclaringType(Node)
Refs #2034
2019-10-26 12:17:43 +02:00
Andreas Dangel
7f31ad186b [ci] Prevent doc build from deploying the binary distribution
The documentation build should only deploy the pmd-doc*.zip
artefacts and not more.
2019-10-26 12:00:41 +02:00
Andreas Dangel
6e6adb9710 [ci] Generate the rule documentation also for pull requests
This will execute the DeadLinksChecker and RuleTagChecker
after the rule documentation has been generated.
2019-10-26 11:56:06 +02:00
Andreas Dangel
dd87fcb968 gitignore docs/pages/pmd/rules 2019-10-26 11:52:20 +02:00
Andreas Dangel
c134f23d7c Move all doc checks into the profile "generate-rule-docs" 2019-10-26 11:52:20 +02:00
Andreas Dangel
4ee8e65417 Upload release notes with the "docs" build.
The github release is first created as a draft, when we edit
the release notes, we publish it (draft=false), so that the
release notification mail contains the full release notes.
2019-10-26 11:52:20 +02:00
Andreas Dangel
7ae9247518 Generate rule docs only with maven profile "generate-rule-docs"
For travis build, PMD needs to be built now before jekyll can
generate the documentation.
In the main build, rule docs are not committed anymore.
2019-10-26 11:51:33 +02:00
Andreas Dangel
37aaa675db Remove the generated rule documentation from repository 2019-10-26 11:51:32 +02:00
Andreas Dangel
f10b631d76 [ci] Only execute deployment provider under linux
Previously it had also been executed under the macosx build,
see https://travis-ci.org/pmd/pmd/jobs/585148459#L6700
2019-10-26 11:39:16 +02:00
Andreas Dangel
f343932a4f [ci] Allow the windows job to fail for now
There seems to be some problem when the deploy phase is executed,
which happens only on pushes - for PRs the deploy is not executed
at all.
Although the deploy is skipped (since this is not a tagged build),
the windows job hangs after that.

Maybe we need to deploy to github releases manually, as we do
for the release notes already. That way, we wouldn't use the
deployment mechanism of travis.
2019-10-26 11:35:29 +02:00
Juan Martín Sotuyo Dodero
c5145994ac Merge pull request #2077 from adangel/travis-windows
[ci] Add travis build on windows
2019-10-25 17:05:54 -03:00
Juan Martín Sotuyo Dodero
d6f0192857 Merge branch 'master' into travis-windows 2019-10-25 17:05:45 -03:00
Andreas Dangel
6f4ccfb979 Add rule integration tests for all other supported languages 2019-10-25 19:50:48 +02:00
Andreas Dangel
5c2bff403d Merge branch 'pr-2068' 2019-10-25 18:20:06 +02:00
Andreas Dangel
c2b484bbc0 [doc] Update release notes, refs #2068 2019-10-25 18:18:16 +02:00
Andreas Dangel
2bc67ea719 [java] Add deprecation javadoc 2019-10-25 18:18:05 +02:00
Andreas Dangel
63395684c4 Merge branch 'pr-2076' 2019-10-25 15:01:58 +02:00
Andreas Dangel
e8a4b5f77e [doc] Update release notes, refs #2076 2019-10-25 15:01:04 +02:00
Andreas Dangel
ecc4e7558f [java] Use full name for CLASS_FAN_OUT metric for operations as well 2019-10-25 14:44:45 +02:00
Andreas Dangel
2b66fb76cb Merge branch 'master' into travis-windows 2019-10-25 14:27:17 +02:00
Andreas Dangel
72d31b2b30 [ci] Update to openjdk 11.0.5+10 2019-10-25 14:27:02 +02:00
Andreas Dangel
1209b162a9 [ci] Explicitly configure known_hosts for web.sourceforge.net 2019-10-24 20:29:16 +02:00
Juan Martín Sotuyo Dodero
9a2314ab5d Merge pull request #2079 from adangel/issue-1531-unusedprivatemethod
[java] UnusedPrivateMethod false-positive with method result
2019-10-23 19:46:48 -03:00
andi
e2877ab95c use full name instead of abbreviation for classfanout & fix spelling 2019-10-22 20:22:20 +02:00
Chen Yang
48fab8cd64 Missing a ; 2019-10-22 21:24:13 +09:00
Chen Yang
80c293e82b Reuse the constructor 2019-10-22 21:13:02 +09:00
Andreas Dangel
abc048ce41 [doc] Update generated rule documentation 2019-10-21 20:41:10 +02:00
Andreas Dangel
7bdb2a03d1 Merge branch 'pr-2078' 2019-10-21 20:32:26 +02:00
Andreas Dangel
c7786d9438 [doc] Update release notes, fixes #1627, refs #2078 2019-10-21 20:32:03 +02:00
Andreas Dangel
50f748e191 [java] UnusedPrivateMethod false-positive with method result
Fixes #1531

In case we determined, that the method argument is a method call,
then we skip now completly trying to determine the correct argument
type. It was half-way fixed before for the first if condition, but
we still evaluated e.g. the allocation expression in

    print(new Integer(1).toString());

and wrongly assumed, the argument type would be an integer,
without taking into account the `toString()` method call.

The same happened with

    privateBooleanMethod(s, "true".equals(s));

where we took the 2nd argument as a literal and assumed
it is a "String", while the method call result actually
is a boolean.

With this change now, the false positive is fixed.

However, since we don't determine the argument type at all, the
method is matched solely on argument count. This will obviously
lead to wrong matches if method overloading is used.
2019-10-20 15:54:10 +02:00
Chen Yang
3abcbaa5a0 Move the resource loader to constructor 2019-10-20 11:26:52 +09:00
andi
7e48b4dcd3 fix documentation 2019-10-19 22:05:29 +02:00
Michael Clay
b32c7ad6a8 [java] DoNotUseThreads should not warn on Runnable #1627 2019-10-19 20:55:49 +02:00
Andreas Dangel
dde5d096d2 [doc] Update release notes, fixes #2071 2019-10-18 19:51:35 +02:00
Andreas Dangel
ce05b1bbb6 [ci] Remove explicit ruby version, use the default 2019-10-18 19:48:14 +02:00