New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xyz.block.kotlin-formatter:kotlin-formatter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xyz.block.kotlin-formatter:kotlin-formatter

A command-line tool designed to enforce consistent code formatting for Kotlin.

  • 1.0.1
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Kotlin Formatter

release main

A command-line tool for formatting Kotlin source code files, implemented as a wrapper around ktfmt.

It can be used to automate code formatting, ensuring a clean and consistent codebase, while integrating seamlessly into development workflows.

The tool can:

  • Format files and directories: Apply consistent formatting to files, directories, or standard input.
  • Integrate with Git workflows:
    • Pre-commit: Format staged files before committing.
    • Pre-push: Check committed files before pushing.

Usage

kotlin-format [OPTIONS] [FILES...]

Options

OptionDescription
--set-exit-if-changedExit with a non-zero code if any files needed changes.
--dry-runDisplay the changes that would be made without writing them to disk.
--pre-commitFormat staged files as part of the pre-commit process. Mutually exclusive with --pre-push.
--pre-pushCheck committed files as part of the pre-push process. Mutually exclusive with --pre-commit.
--push-commit=<text>The SHA of the commit to use for pre-push. Defaults to HEAD.
--print-statsEmit performance-related statistics to help diagnose performance issues.
-h, --helpShow help message and exit.

Arguments

ArgumentDescription
<files>Files or directories to format. Use - for standard input.

CLI

A fat jar of the CLI is available on Maven Central. To download the CLI, replace $version with the latest version number in the following URL:

https://repo1.maven.org/maven2/xyz/block/kotlin-formatter/kotlin-formatter/$version/kotlin-formatter-$version-all.jar

After downloading, you can run the CLI using the following command:

java -jar path/to/kotlin-formatter-$version-all.jar [OPTIONS] [FILES...]

FAQs

Package last updated on 14 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc