Skip to content

Integration with pre-commit(.com) #332

@1Mark

Description

@1Mark

Hi there,

I was trying to write a simple
pre-commit-config.yaml like so

repos:
- repo: local
  hooks:
  - id: formatKotlin
    name: formatting files using kolinter
    entry: ./gradlew formatKotlin
    language: system

However, since pre-commit.com passes the changed files to ./gradlew formatKotlin it fails with

Task src/blah/file.kt not found in root project 'blahblah'.

I have seen #207 and #155 but I was still unsure how to resolve. I considered using https://github.com/macisamuele/language-formatters-pre-commit-hooks/blob/f5149294026e063cf1b9e28670e43ee5c624d2f9/.pre-commit-hooks.yaml#L25-L30 but was worried that klint would fall out of sync with kolinter.

Please advise

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions