Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pmd bears on Windows #2942

Merged
merged 11 commits into from
Aug 7, 2019
Merged

Fix pmd bears on Windows #2942

merged 11 commits into from
Aug 7, 2019

Conversation

jayvdb
Copy link
Member

@jayvdb jayvdb commented Aug 3, 2019

For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!

Checklist

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    individually.
    It is not sufficient to have "fixup commits" on your PR,
    our bot will still report the issues for the previous commit.) You will
    likely receive a lot of bot comments and build failures if coala does not
    pass on every single commit!

After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will
review your PRs faster!

@jayvdb
Copy link
Member Author

jayvdb commented Aug 3, 2019

Note there is now another error, with phpmd. #2943

AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
CAN_DETECT = {'Duplication'}

@classmethod
def check_prerequisites(cls):
if which('bash') is None:
return 'bash is not installed.'
if which('pmd') is None and which('run.sh') is None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while the error message isnt as good, the AnyOneOfRequirements above does the same thing.

And removing the 'bash' prefix should be enough to make pmd work on Windows.

@jayvdb jayvdb force-pushed the win-disable-pmd branch 3 times, most recently from b710ded to 4d74a61 Compare August 5, 2019 09:09
@jayvdb jayvdb requested a review from areebbeigh August 5, 2019 09:27
@jayvdb jayvdb changed the title Disable pmd bears on Windows Fix pmd bears on Windows Aug 5, 2019
lxml 4.4.0 dropped support for Python 3.4.
Hence, the version is capped below 4.4.0.

Closes coala#2940
Custom rules in tox.ini are migrated into get_tests.py so
that they can be documented and dynamically collated together.

Related to coala#1476
Disable PHPMessDetectorBearTest test test_cleancode_violation,
as it is currently failing due to a minor text change in the
error emitted by the linter.

Related to coala#2943
XMLBearDTDUrlTest.test_valid_files is consistently failing only
on Travis Windows, but not AppVeyor.

Related to coala#2944
Avoid including paths from executable dependencies,
and sync with package_manager adding new distribution class 'pkg'.
Describe current executable requirements of cpd or run.sh,
replacing check_prerequisites with Requirement classes.

Also remove explicit invocation using `bash`, which was
ineffective as which('run.sh') would only be successful
if the script was executable, and the run.sh script is not
written to be compatible with invocation on Windows.

This de-supports any usage where `pmd` existed and was a script
which could invoke `cpd`.  It fixes usage where `pmd` is not a
script, like it is an executable shim when installed with choco.

Also remove duplication of `CPDBear` in generate_bear_metadata.py
which was intended to make 'cpd' deselectable, but was broken.
It is now mostly unnecessary as the ExecutableRequirement classes
provide the `cpd` tag, however the `java` tag is still manual.

Reduce the required coverage percentage to 98%.

Fixes coala#2937
Related to coala#2908
Describe current executable requirements of pmd or run.sh.

Also remove explicit invocation using `bash`, which was
ineffective as which('run.sh') would only be successful
if the script was executable.

Also add `-f text` arguments, which are mandatory on recent
versions of pmd, but were optional on older supported versions.

Fixes coala#2908
The unix pmd installer only creates an executable run.sh
Choco package pmd now works on Windows, but
disable its dependency on jre8.

Closes coala#2908
Related to coala#651
XMLBearDTDUrlTest times out regular on Travis Windows.
Increase the timeout for that test to 120s.

Related to coala#2944
@jayvdb jayvdb merged commit c3ae6bc into coala:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants