ktfmt
editorconfig-vim
Our great sponsors
ktfmt | editorconfig-vim | |
---|---|---|
9 | 134 | |
816 | 3,104 | |
3.3% | 0.5% | |
8.4 | 4.5 | |
about 21 hours ago | 15 days ago | |
Kotlin | Vim Script | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ktfmt
-
Pre-push Hooks
The script below will run ktfmt over a Kotlin codebase and fail the push if any of the files are not well-formatted. It does also use a custom Gradle plugin we built around ktfmt, which accepts a --run-over change set. This script will leave the fixed formatting changes in the tree, awaiting the developer to intervene, commit, and try again.
- Ktfmt – The Kotlin Code Formatter
-
Google's Kotlin Style Guide vs Kotlin Official Code Style
My team uses ktfmt. It is more aggressive and opinionated about formatting than ktlint, which we view as a good thing.
-
What are the good code formatters for Kotlin?
I can recommend ktfmt. It is based on the fast Google Java Formatter and produces deterministic formatting. Plugins for Maven, Gradle and IntelliJ are available.
-
A friend took a look at my code and asked if I needed mental help. Is he right? What are your thoughts?
The only sane formatting tool for Kotlin is ktfmt. https://github.com/facebook/ktfmt
- From zero to 10M lines of Kotlin
-
A few Kotlin questions from a Rustacean
Others have covered most of your questions, but since you asked about linters: if you want a highly opinionated formatter in the spirit of gofmt or google-java-format, you can check out ktfmt.
-
Diktat 1.0.0 released
Facebook's ktfmt (https://github.com/facebookincubator/ktfmt) does that.
editorconfig-vim
-
Most basic code formatting
These are tools that you need to add. But the most elemental code formatting is not here, it is in the widely supported .editorconfig file.
-
Taking the Language Server Protocol one step further
Hello,
Maybe you should check this project:
https://editorconfig.org/
Regards,
- How to config indentation per project?
-
How We Started Managing BSA Delivery Processes on GitHub
editorconfigchecker. A linter that checks files for compliance with editorconfig rules. Another linter that helps maintain consistency in the format of all files.
-
Ask HN: What work/office purchase transformed your life?
Oh, yeah, we had that issue too and solved it pretty successfully with `.editorconfig` (shareable between VScode and IntelliJ, https://editorconfig.org/) combined with `prettier`.
Each IDE is configured to:
- Not reformat code on its own
- Ignore whitespace
- Run `prettier` as a pre-commit hook
Those settings are saved to `.editorconfig` where possible, or to each IDE's repo-specific folder (e.g. `.idea`).
Then in theory each developer can use whatever IDE they want, whatever whitespace settings they want (tabs vs spaces), and the end code committed to the repo is still the same.
-
Rider - Formatting across projects
I am aware of .editorconfig, and one day that may be the correct answer but the specification does not support every element of the styles of both oss and css.
-
Is there any reason to keep the editorconfig plugin installed?
Does this mean I can completely get rid of this plugin?: https://github.com/editorconfig/editorconfig-vim
-
Is there really no support for editorconfig, yet?
[1] https://editorconfig.org
- How do you handle code formatting in a team?
-
Announcing C# Dev Kit for Visual Studio Code
I dunno who downvoted your question, but I believe you can use .editorconfig to set that up for you.
What are some alternatives?
diktat - Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
nvim-projectconfig - neovim projectconfig
KotlinLanguageServer - Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol
pycodestyle - Simple Python style checker in one Python file
Anki-Android - AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
project-config.nvim - Per project config for Neovim
javalin.github.io - Javalin website source code
tabset.nvim - A Neovim plugin to easily set tabstop, shiftwidth and expandtab settings for file types.
kotlinter-gradle - Painless, fast ktlint plugin for Gradle
prettier - Prettier is an opinionated code formatter.
galoisenne - 🕸️ Graphs, finite fields and discrete dynamical systems in Kotlin
emacs-solidity - The official solidity-mode for EMACS