Skip to main content

Library that provides ability to fix naming and comments in Kotlin code files according to Kotlin code conventions

Project description

Kotlin Style Check


This open-source python package automatically fixes your Kotlin code to follow coding conventions listed here:

https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules

https://kotlinlang.org/docs/reference/coding-conventions.html#documentation-comments


Installation

https://pypi.org/project/kotlin-style-check/

pip install kotlin_style_check


RECOMMENDED: Usage from command line:

Searches for all .kt files in given path and fixes naming and comments errors

python -m kotlin_style_check --input_path


Usage as library (generally not recommended for casual users, but you can try):

Example

from kotlin_style_check import KotlinStyleChecker

print(KotlinStyleChecker().fix(["val My_Var = 5;"], ["out.log"])) # outputs "val myVar = 5;", logs changes to "out.log"

Short description of class KotlinStyleChecker

def fix_in_files(self, input_path) # input_path - path to dir or file to fix code style. logs data relatively to this path

def run_tests(self, log_file) # runs small checks

def setup_logger(self, log_file, level=logging.INFO) # needed to log data when calling lower level functions of this class (check_comments for example), overwrites it's global logger

""" ... other stuff you can find in source code """

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kotlin_style_check-1.0.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file kotlin_style_check-1.0.tar.gz.

File metadata

  • Download URL: kotlin_style_check-1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.4

File hashes

Hashes for kotlin_style_check-1.0.tar.gz
Algorithm Hash digest
SHA256 0239631fbe01fde29407d4c4d2caef48fb21815374f7c075a22b9de0e5fc2d74
MD5 a63073ee155b7a0dbb2681779d680c03
BLAKE2b-256 2fbbed52bf1888498cd2067fadc712a0c5ec853aaea89d130fa65b65c1871a19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page