forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaPMDBear: Use ExecutableRequirement
Describe current executable requirements of pmd or run.sh. Related to coala#2937
- Loading branch information
Showing
1 changed file
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
from shutil import which | ||
|
||
from dependency_management.requirements.AnyOneOfRequirements import ( | ||
AnyOneOfRequirements) | ||
from dependency_management.requirements.ExecutableRequirement import ( | ||
ExecutableRequirement) | ||
|
||
from coalib.bearlib.abstractions.Linter import linter | ||
from coalib.bearlib import deprecate_settings | ||
from coala_utils.param_conversion import negate | ||
|
@@ -17,6 +22,13 @@ class JavaPMDBear: | |
""" | ||
|
||
LANGUAGES = {'Java'} | ||
REQUIREMENTS = { | ||
AnyOneOfRequirements( | ||
[ExecutableRequirement('pmd'), | ||
ExecutableRequirement('run.sh'), | ||
] | ||
), | ||
} | ||
AUTHORS = {'The coala developers'} | ||
AUTHORS_EMAILS = {'[email protected]'} | ||
LICENSE = 'AGPL-3.0' | ||
|
@@ -25,9 +37,7 @@ class JavaPMDBear: | |
|
||
@classmethod | ||
def check_prerequisites(cls): | ||
if which('bash') is None: | ||
return 'bash is not installed.' | ||
elif which('pmd') is None and which('run.sh') is None: | ||
if which('pmd') is None and which('run.sh') is None: | ||
return ('PMD is missing. Make sure to install it from ' | ||
'<https://pmd.github.io/>') | ||
else: | ||
|