Skip to content

Commit

Permalink
KotlinLintBear.py: Add ktlint
Browse files Browse the repository at this point in the history
Lints your Kotlin files. Check code for coding standards and
semantical problems.

Closes coala#2152

Modified KotlinLintBear.py

Further Modified KotlinLintBear.py

Add init.py
  • Loading branch information
parimatrix committed Dec 15, 2017
1 parent 28e4b8f commit 73458f7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions bears/kotlin/KotlinLintBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os

from coalib.bearlib.abstractions.Linter import linter


@linter(executable='ktlint',
use_stderr=True,
use_stdout=True)
class KotlinLintBear:
"""
Lints your Kotlin Files.
Check code for coding standards or semantical problems that might lead
to problems in execution of the code.
See https://ktlint.github.io for more info.
"""
LANGUAGES = {'CSS'}
REQUIREMENTS = {'ktlint'}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
CAN_DETECT = {'Formatting', 'Syntax'}

def process_output(self, output, filename, file):
stdout, stderr = output
dirpath = os.getcwd()
stdout = stdout.replace(dirpath+'\\', '')
print(stdout)

@staticmethod
def create_arguments(filename, file, config_file):
return('--color', filename)
Empty file added bears/kotlin/__init__.py
Empty file.

0 comments on commit 73458f7

Please sign in to comment.