Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coala/coala-bears
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f67eab6b53b76b33ae3c37d9de43ed4a575308b7
Choose a base ref
..
head repository: coala/coala-bears
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3467f40428279b1c81a5f27adf4e5e13c4bc82f0
Choose a head ref
2 changes: 1 addition & 1 deletion .ci/deps.java.sh
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@ if [ -z "$jdk_version" ] || [ $jdk_version -eq 8 ]; then
.ci/deps.tailor.sh
fi

if [ -z "$(which pmd || true)" ]; then
if [ -z "$(which run.sh || true)" ]; then
.ci/deps.pmd.sh
fi
16 changes: 7 additions & 9 deletions .ci/generate_bear_metadata.py
Original file line number Diff line number Diff line change
@@ -180,6 +180,10 @@ def helper(requirements, instance_dict):
instance_dict[type(requirement).__name__].add(requirement)


def _clean_executable(executable):
return executable.rpartition('/')[2].lower().replace('.exe', '')


def get_all_requirements(bears):
bear_requirements = {}

@@ -189,7 +193,7 @@ def get_all_requirements(bears):
if hasattr(bear, 'get_executable'):
executable = bear.get_executable()
if executable:
requirement = ExecutableRequirement(executable)
requirement = ExecutableRequirement(_clean_executable(executable))
instance_dict['ExecutableRequirement'].add(requirement)
helper(bear.REQUIREMENTS, instance_dict)
bear_requirements[str(bear.name)] = instance_dict
@@ -318,11 +322,6 @@ def get_bear_tags(bear, metadata):
tags.remove('java')
tags.add('opam')

elif bear.name == 'CPDBear':
# Has no requirements defined yet
tags.remove('noreqs')
tags.add('java')

elif bear.name == 'LanguageToolBear':
# Has no requirements defined yet
tags.add('java')
@@ -333,8 +332,7 @@ def get_bear_tags(bear, metadata):
tags.add('pmd')

elif bear.name == 'CPDBear':
# Has no executable defined
tags.add('cpd')
tags.add('java')

elif bear.name == 'VHDLLintBear':
# Has no executable defined
@@ -458,7 +456,7 @@ def sort_requirements(req_dict):
'This is an automatically generated file.\n'
'And should not be edited by hand.')

requirements['overrides'] = 'package-manager-requirements.yaml'
requirements['overrides'] = 'pm-requirements.yaml'
get_bear_requirement_metadata(bear_requirement_sets=instance_dict,
storage=requirements, old_labels=True)

2 changes: 2 additions & 0 deletions .ci/generate_coverage_thresholds.py
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@ def main():
bear = bear.replace('/', '\\\\')
if 'CheckstyleBear' in bear or 'CMakeLintBear' in bear:
threshold = 90
elif 'CPDBear' in bear:
threshold = 98

thresholds[bear] = threshold

50 changes: 48 additions & 2 deletions .ci/get_tests.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
WINDOWS_BROKEN = set((
'bakalint', # not installed
'phpcs', # https://github.com/coala/coala-bears/issues/2916
'pmd', 'cpd', # https://github.com/coala/coala-bears/issues/2908
'mcs', # choco mono isnt providing this in the PATH
'tailor', # installer fails
'shellcheck', # https://github.com/coala/coala-bears/issues/2920
@@ -123,14 +122,44 @@ def get_tests(bears):
return tests


def get_pytest_deselected_tests(args, tests):
not_list = []

# language-check fails for different locale on windows
if 'tests/documentation/DocGrammarBearTest.py' in tests:
if 'win' in args:
not_list.append('test_language_french')

# async is not available on Python 3.4
if 'tests/python/YapfBearTest.py' in tests:
if 'py34' in args:
not_list.append('test_valid_async')

# https://github.com/coala/coala-bears/issues/2943
if 'tests/php/PHPMessDetectorBearTest.py' in tests:
not_list.append('test_cleancode_violation')

# https://github.com/coala/coala-bears/issues/2944
if 'tests/xml2/XMLBearTest.py' in tests:
if 'win' in args and os.environ.get('TRAVIS'):
not_list.append(
'tests/xml2/XMLBearTest.py::XMLBearDTDUrlTest::test_valid_files')

return not_list


def main():
args_orig = sys.argv[1:]
metadata = get_metadata()

include_disabled = False
show_deselected = False
if args_orig[0] == '--disabled':
include_disabled = True
args_orig = args_orig[1:]
elif args_orig[0] == '--deselected':
show_deselected = True
args_orig = args_orig[1:]

args = []
for arg in args_orig:
@@ -149,7 +178,24 @@ def main():

bears = get_bears(metadata, args, include_disabled)
tests = get_tests(bears)
print(' '.join(sorted(tests)))
if show_deselected:
not_list = get_pytest_deselected_tests(args, tests)
deselect_list = [item for item in not_list if '::' in item]
not_list = [item for item in not_list if item not in deselect_list]
if len(not_list) > 1:
not_list = '-k "not ({})"'.format(' or '.join(not_list))
elif len(not_list) == 1:
not_list = '-k "not {}"'.format(not_list[0])
else:
not_list = ''
if deselect_list:
deselect_list = ' --deselect={}'.format(
' --deselect='.join(deselect_list))
else:
deselect_list = ''
print(not_list + deselect_list)
else:
print(' '.join(sorted(tests)))


if __name__ == '__main__':
4 changes: 4 additions & 0 deletions .moban.yaml
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ choco_requirements:
# overrides for package managers not yet used
visualstudio2017-workload-vctools: false
MinGW: false
maven: false # MavenRequirement is unused
miniconda3: false
R.Project: false # https://github.com/coala/coala-bears/issues/2919
luarocks: false # https://github.com/coala/coala-bears/issues/2918
@@ -66,6 +67,9 @@ choco_requirements:
cppcheck: true
xsltproc: true
ShellCheck: true # https://github.com/coala/coala-bears/issues/2920
pmd:
# pmd depends on jre8, unnecessary duplication of adoptopenjdk
args: --ignore-dependencies

# The first entry is the most supported
# Latter entries which are higher versions may have some bears disabled
12 changes: 5 additions & 7 deletions Fudgefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
"adoptopenjdk": ".ci/nuspecs/adoptopenjdk.nuspec",
"golang": ".ci/nuspecs/golang.nuspec",
"hg": ".ci/nuspecs/hg.nuspec",
"maven": ".ci/nuspecs/maven.nuspec",
"nodejs": ".ci/nuspecs/nodejs.nuspec",
"python": ".ci/nuspecs/python.nuspec",
"ruby": ".ci/nuspecs/ruby.nuspec",
@@ -64,12 +63,6 @@
"source": "",
"version": "5.24.3.2404"
},
{
"appveyor_id": true,
"name": "maven",
"source": "",
"version": "3.5.4"
},
{
"name": "php",
"source": ""
@@ -97,6 +90,11 @@
{
"name": "ShellCheck",
"source": ""
},
{
"args": "--ignore-dependencies",
"name": "pmd",
"source": ""
}
],
"scripts": {
Loading