-
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.
infras: decoupling multiDeclRefactor with checkstyle backend. Add con…
…troller of checkstyle as a middleware.
- Loading branch information
1 parent
5daa44b
commit 8043286
Showing
3 changed files
with
35 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
import json | ||
|
||
import multiDeclRefactor | ||
|
||
### key: issue name in checkstyle, | ||
### value: refactor method main entry | ||
REFACTOR_DICT = { | ||
"HackedMultipleVariableDeclarations" : multiDeclRefactor.refactor_decls | ||
} | ||
|
||
def main(): | ||
try: | ||
data = json.load(sys.stdin) | ||
|
||
for issue, refactor in REFACTOR_DICT.iteritems(): | ||
refactor(data[issue]) | ||
|
||
except ValueError: | ||
for line in sys.stdin: | ||
print line | ||
sys.exit(1) | ||
|
||
if __name__ == '__main__': | ||
main() |
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