Skip to main content

List of pre-commit hooks meant to format your source code.

Project description

Language Formatters Pre Commit Hooks

About

This package provides utilities for ensuring that your code is nicely formatted by using pre-commit hooks

List of pretty-format hooks

  • pretty-format-golang
  • pretty-format-ini
  • pretty-format-java
  • pretty-format-kotlin
  • pretty-format-rust
  • pretty-format-toml
  • pretty-format-yaml

⚠: the list above could be out-of-sync respect the exposed pre-commit hooks.
Please refer to .pre-commit-hooks.yaml for a more updated list.

Example Usage

Add a similar snippet into your .pre-commit-config.yaml file

- repo: git@github.com:macisamuele/language-formatters-pre-commit-hooks
  rev: ${LATEST_SHA_OR_VERSION}
  hooks:
  - id: pretty-format-java
    args: [--autofix]
  - id: pretty-format-kotlin
    args: [--autofix]
  - id: pretty-format-yaml
    args: [--autofix, --indent, '2']

Development

This tool uses tox as main tool to build virtual environments.
To get started will be enough to run make development.

If you have aactivator installed this step will happen automatically.

Contributing

Contributions are always welcome.

  1. Fork the project ( http://github.com/macisamuele/language-formatters-pre-commit-hooks/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add your modifications
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

language-formatters-pre-commit-hooks is licensed with Apache License version 2.0.

Changelog

1.4.1 (2020-06-03)

  • Update KTLint to 0.37.0

1.4.0 (2020-05-20)

  • Improve handling of multi-document YAML files. PR #3 - @dan-cohn thanks for your contribution
  • pretty-format-java does default to Google style. Add --aosp argument for Android Open Source Project style. PR #8 - @ChenAndrew thanks for your contribution.
  • Update GoogleJavaFormatter to 1.8

1.3.2 (2020-01-25)

  • Definitive packaging fix

1.3.1 (2020-01-24)

  • Update Packaging informations

:warning: This version broke module retrieval (:disappointed:) while improving quality of PyPi uploaded information. You're recommended to use a more recent version of the library.

1.3.0 (2020-01-24)

  • Update KTLint to 0.36.0
  • Enhange pretty-format-yaml to deal with YAML files containing primitive types only - PR #1 - @dan-cohn thanks for your contribution

1.2.5 (2019-11-22)

  • Update KTLint to 0.35.0

1.2.4 (2019-07-19)

  • Update KTLint to 0.34.0 and fix KTLint GitHub link

1.2.3 (2019-02-14)

  • Update Google Java Formatter to 1.7 and KTlint to 0.30.0

1.2.2 (2018-11-20)

  • pretty-format-rust fails if cargo fmt fails

1.2.1 (2018-11-20)

  • no-diff release

1.2.0 (2018-11-20)

  • Bump KTlint to 0.29.0
  • Remove duplicated filenames from command execution

1.1.3 (2018-09-02)

  • Last fix to cargo invocations to use the environmentally defined toolchain

1.1.2 (2018-09-02)

  • Bump KTlint to 0.27.0

1.1.1 (2018-09-02)

  • Ensure that generated files end with a new line
  • Allow rust toolchain customization via RUST_TOOLCHAIN environment variable

1.1.0 (2018-07-29)

  • Add pretty formatters for INI, Rust and TOML files

1.0.1 (2018-07-20)

  • Improve detection of modified files from kotlin formatter

1.0.0 (2018-07-20)

  • Initial release: added pretty formatters for Golang, Java, Kotlin and YAML

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

Built Distribution

File details

Details for the file language_formatters_pre_commit_hooks-1.4.1.tar.gz.

File metadata

  • Download URL: language_formatters_pre_commit_hooks-1.4.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for language_formatters_pre_commit_hooks-1.4.1.tar.gz
Algorithm Hash digest
SHA256 6760e70f9d2430c87d7cf1445f7f9fee449c6955879ba2c22ecb21058178f584
MD5 338a78305163f94be3ac6cc935c0c913
BLAKE2b-256 5ba6cd20b1ecd6057847fe1bad14ad531a56d3c6315ba1adad44c270f708fc5d

See more details on using hashes here.

File details

Details for the file language_formatters_pre_commit_hooks-1.4.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for language_formatters_pre_commit_hooks-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4476c47322b1d111dafcbf36ceee9b572fddb9332356abb395e95ad4e883a895
MD5 7785900c420b93335b5a7f72aaea2ae0
BLAKE2b-256 f0e03dbb9cf210188294cc84598861f20b522c6ad887467c0e503f875e0bb82e

See more details on using hashes here.

Supported by

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