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

Add kotlin-logging as logging framework #1327

Merged
merged 7 commits into from
Jan 29, 2022

Commits on Dec 28, 2021

  1. Add kotlin-logging as logging framework

    Refactor output written to stdout / stderr to log statements where applicable.
    
    The kotlin-logging framework uses SLF4J as underlying logging framework. The
    latter framework does not allow to change the desired log level to be changed
    at runtime. As ktlint supports the command line flag "--debug" to print
    additional logging, it was needed to add logback as underlying logging
    framework.
    
    The IndentationRule and the RuleExtension class both changed the logging
    behavior based on the environment variable KTLINT_DEBUG. This variable could
    be assigned multiple values. This variable is now split into two distinct
    variables KTLINT_UNIT_TEST_TRACE and KTLINT_UNIT_TEST_DUMP_AST which can
    either be set to "on" to enable TRACE resp. DUMP_AST functionality or
    anything else to disable it. End users of ktlint should use the new command
    line flag "--trace" resp. the existing "--print-ast".
    
    Solved a bug in DumpASTRule when retrieval of the linenumber results in a
    IndexOutOfBoundsException cause by an AST mutation resulting in an invalid
    offset.
    
    In RuleExtension improved the logic regarding dumping the AST. When invoked
    from the extension, the DumpASTRule print the output to STDOUT instead of
    STDERR.
    
    Following needs explicit attention while reviewing:
    * Check the way the Gradle dependencies are added. I have little knowledge of Gradle.
    * I was not able to find published checksums for the added dependencies, so I have added the Gradle generated keys
    Paul Dingemans committed Dec 28, 2021
    Configuration menu
    Copy the full SHA
    90d7e38 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2022

  1. Merge remote-tracking branch 'upstream/master' into 589-kotling-logging

    # Conflicts:
    #	gradle/verification-metadata.xml
    #	ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/IndentationRule.kt
    #	ktlint/src/main/kotlin/com/pinterest/ktlint/Main.kt
    #	ktlint/src/main/kotlin/com/pinterest/ktlint/internal/GitHookInstaller.kt
    #	ktlint/src/main/kotlin/com/pinterest/ktlint/internal/PrintASTSubCommand.kt
    #	ktlint/src/main/kotlin/com/pinterest/ktlint/internal/RuleSetsLoader.kt
    Paul Dingemans committed Jan 23, 2022
    Configuration menu
    Copy the full SHA
    4c3b1d5 View commit details
    Browse the repository at this point in the history
  2. Fix tests regarding warning when a provided JAR does not contain a ru…

    …leset
    
    Note: The jar "ktlint-ruleset-experimental.jar" which previously was used
    as invalid jar in the unit test, was replaced in the master branch with a
    jar that actually does contain a ruleset provider. Now a new JAR (the
    "ktlint-reporter-html.jar") is added which does not contain a ruleset
    provider. Also the tests have been changed to check in the normal output
    for absence or existence of the warning.
    Paul Dingemans committed Jan 23, 2022
    Configuration menu
    Copy the full SHA
    b8e0990 View commit details
    Browse the repository at this point in the history
  3. Change log level of messages regarding which file is being processed …

    …and what .editorconfig value are applicable from debug to trace
    
    Loglevel debug is enabled by the verbose mode which is commonly used on the CLI to detect
    which rule actually is throwing the lint error. This same flag is also used by the build
    step which checks the ktlint source code for violations. Due to way too many errors, it
    became too hard to find the files/lines which need to be changed.
    Paul Dingemans committed Jan 23, 2022
    Configuration menu
    Copy the full SHA
    37cd61e View commit details
    Browse the repository at this point in the history
  4. Fix lint violations after merge "master" into branch "589-kotling-log…

    …ging"
    Paul Dingemans committed Jan 23, 2022
    Configuration menu
    Copy the full SHA
    0901c70 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2022

  1. Merge remote-tracking branch 'upstream/master' into 589-kotling-logging

    # Conflicts:
    #	ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/RuleExtension.kt
    Paul Dingemans committed Jan 28, 2022
    Configuration menu
    Copy the full SHA
    d6d05b7 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2022

  1. Configuration menu
    Copy the full SHA
    de594ed View commit details
    Browse the repository at this point in the history