forked from pantsbuild/pants
-
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.
Fix scalastyle task, wire it up, make configs optional + refactoring …
…and unit tests - fix the task, which has slipped out of maintenance. - wire it up in OS pants. - but make it flexible so that pants_internal or other private wrapper of OS pants won't fail if they don't have scalastyle config and excludes present (making config/exclude optional) - some refactoring so I can write unit tests easily. - unit tests and end to end tests Testing Done: - CI passed: https://travis-ci.org/jinfeng/jinfeng-pants-fork/builds/37824308 - - PANTS_DEV=1 ./pants goal test tests:: - positive manual test: $ PANTS_DEV=1 ./pants goal compile examples/src/scala/com/pants/example/hello/welcome ... ... ... 16:00:13 00:02 [compile] 16:00:13 00:02 [jvm] ... ... 16:00:22 00:11 [scalastyle] 16:00:22 00:11 [bootstrap-scalastyle] 16:00:23 00:12 [org.scalastyle.Main] Waiting for background workers to finish. SUCCESS - negative manual test (with the examples/src/scala/com/pants/example/Welcome.scala to break the ImportGroupingChecker rule: $ PANTS_DEV=1 ./pants goal compile examples/src/scala/com/pants/example/hello/welcome ... ... ... 16:03:42 00:00 [compile] 16:03:42 00:00 [jvm] ... ... 16:03:44 00:02 [scalastyle] 16:03:44 00:02 [org.scalastyle.Main] ==== stderr ==== ==== stdout ==== error file=/Users/jinfeng/workspace/github-pants-jinfeng/examples/src/scala/com/pants/example/hello/welcome/Welcome.scala message=Imports should be grouped together line=13 column=0 Processed 1 file(s) Found 1 errors Found 0 warnings Finished in 56 ms FAILURE: java org.scalastyle.Main ... exited non-zero (1) Waiting for background workers to finish. FAILURE Bugs closed: 647 Reviewed at https://rbcommons.com/s/twitter/r/1145/
- Loading branch information
Showing
12 changed files
with
447 additions
and
44 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<scalastyle commentFilter="enabled"> | ||
<name>Default Scalastyle configuration</name> | ||
<check level="error" class="org.scalastyle.scalariform.ImportGroupingChecker" enabled="true"></check> | ||
</scalastyle> |
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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
name = 'plugin', | ||
sources = ['__init__.py', 'register.py'], | ||
dependencies = [ | ||
'src/python/pants/backend/jvm/tasks:scalastyle', | ||
'src/python/pants/goal:task_registrar', | ||
] | ||
) | ||
|
Empty file.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# coding=utf-8 | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, | ||
print_function, unicode_literals) | ||
|
||
from pants.backend.jvm.tasks.scalastyle import Scalastyle | ||
from pants.goal.task_registrar import TaskRegistrar as task | ||
|
||
|
||
def register_goals(): | ||
task(name='scalastyle', action=Scalastyle, | ||
dependencies=['bootstrap'] | ||
).install('compile').with_description('Scala source code style check.') |
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
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
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
Oops, something went wrong.