A command line tool to keep files correct in respect of your EditorConfig
  • Rust 98.2%
  • Just 1%
  • Handlebars 0.8%
Find a file
Michael Baumgartner de333dcbd8
All checks were successful
/ release_validation (push) Successful in 1m45s
/ release_check (push) Successful in 8m34s
/ release_lint (push) Successful in 11m51s
/ release_test (push) Successful in 6m9s
/ release_targets (aarch64-unknown-linux-gnu) (push) Successful in 10m45s
/ release_targets (x86_64-pc-windows-gnu) (push) Successful in 5m58s
/ release_targets (x86_64-unknown-linux-gnu) (push) Successful in 5m9s
/ release_targets (x86_64-unknown-linux-musl) (push) Successful in 5m27s
/ release_crate_codeberg (push) Successful in 2m5s
/ release_crate_io (push) Successful in 2m14s
/ release_info (push) Successful in 41s
Bump to 0.1.1
2026-02-22 14:39:34 +01:00
.forgejo Merge branch 'main' into feature/16-pre-commit 2026-02-22 13:08:32 +01:00
.schemata Add REUSE.toml schema 2025-09-22 10:28:25 +02:00
.vscode Documente installation methods 2025-10-13 10:25:17 +02:00
LICENSES Save schemata in repository 2025-09-22 10:21:26 +02:00
src Adjust CommandArgs getter 2026-02-19 15:25:37 +01:00
tests Remove .license files for workaround 2026-02-14 17:27:42 +01:00
.codespellrc Linter: Ignore target folder 2026-01-04 09:34:54 +01:00
.editorconfig Add Issue templates 2025-08-26 15:11:35 +02:00
.gitattributes Git: Configure line break handling 2025-09-23 14:32:06 +02:00
.gitignore Add License informations with REUSE 2025-08-25 18:38:49 +02:00
.pre-commit-config.yaml Verbose pre-commit hooks 2026-02-22 13:19:30 +01:00
.pre-commit-hooks.yaml Verbose pre-commit hooks 2026-02-22 13:19:30 +01:00
.rustfmt.toml pre-commit: Only process changed file if possible 2025-09-22 12:21:06 +02:00
.taplo.toml Add REUSE.toml schema 2025-09-22 10:28:25 +02:00
.yamllint.yaml Add test action 2025-10-04 16:18:08 +02:00
about.hbs Switch to markdown for cargo-about report 2025-10-01 16:24:52 +02:00
about.toml Keep license lists in sync 2025-10-03 19:39:43 +02:00
build.rs Do not use cargo-about at docs.rs 2026-02-19 17:37:04 +01:00
Cargo.lock Bump to 0.1.1 2026-02-22 14:39:34 +01:00
Cargo.toml Bump to 0.1.1 2026-02-22 14:39:34 +01:00
deny.toml Ignore security issue upstream dependencies 2026-02-14 17:25:43 +01:00
Development.md Merge branch 'main' into feature/16-pre-commit 2026-02-22 13:08:32 +01:00
justfile Lint action(s) without pre-commit 2025-10-05 10:57:39 +02:00
README.md Document pre-commit hooks 2026-02-19 10:37:08 +01:00
REUSE.toml Add License informations with REUSE 2025-08-25 18:38:49 +02:00
rust-toolchain.toml Update Rust version 2026-02-22 10:26:09 +01:00

ecformat

A command line tool to keep files correct in respect of your EditorConfig.

The project is currently in an early stage of development, not yet ready for productive usage.

Supported EditorConfig properties

The current ecformat version targets the version 0.17.2 of EditorConfig. Only if a property is set in your .editorconfig for a file, ecformat will handle this property on that file during the check and the fix command. When processing file contents, the charset of your EditorConfig is respected. If there is no charset configured for a file, ecformat uses utf-8 as the fallback to process the other properties. In the section Disable EditorConfig properties of the command helps (see ecformat help check or ecformat help fix) you can find options to disable the handling of specific properties. From the properties of EditorConfig, ecformat currently supports the following ones:

charset

ecformat determines the actual encoding of a file from its content. If that mismatch the configured one, the check has an error at that file and fix converts the content into the configured encoding.

end_of_line

ecformat considers all end of lines in a file. If not only the configured style is used, the check has an error at that file and fix changes all end of lines to the configured style.

Installation

Codeberg Release Crate dependency status

You can find the installation options for each version in the respective release on Codeberg.

Rust Crate

Crates.io Version Crates.io Total Downloads

You can install the latest version of the crate from crates.io

cargo install --locked ecformat

Make sure you have the cargo bin directory (default is $HOME/.cargo/bin) in your PATH variable.

If you want to remove ecformat from your machine again, run the following:

cargo uninstall ecformat

It is also possible to use the crate as library in your Rust project (see Crate documentation for usage details). If you only use it in your build scripts, you should add it as a build dependency:

cargo add --build ecformat

As alternative to crates.io, you can use the ecformat Crate package on Codeberg (see there for details).

Pre-commit hooks

pre-commit

There are two pre-commit hooks available for ecformat.

repos:
  - repo: https://codeberg.org/BaumiCoder/ecformat
    rev: vx.y.z # Set exact ecformat version x.y.z here
    hooks:
      # Entire repository only if a .edtiorconfig file changes
      # (also recommended for stage manual)
      - id: ecformat_repo
        args: ["check", "-v"] # default arguments (optional)
      # Only process the changed files
      - id: ecformat
        args: ["check", "-v"] # default arguments (optional)

Download binary

The binaries of the versions are available for some common platforms in the ecformat_bin package on Codeberg.

Build from source

Another option is to build from source. If you have Rust installed, clone the repository and checkout the version you want to install.

git checkout tags/vx.y.z

For version x.y.z or download a source code archive from the respective release.

Make sure you have the cargo bin directory (default is $HOME/.cargo/bin) in your PATH variable. Then install the crate with the following command inside the repository / unpacked archive:

cargo install --locked --path .

If you want to remove ecformat from your machine again, run the following:

cargo uninstall ecformat

If you only want to create the binary for your platform, run the following to get it in the directory target/release:

cargo build --locked --release

License

REUSE status

The project is licensed under the Blue Oak Model License 1.0.0. A modern permissive license which is also easier to understand. You can find a brief FAQ on the steward's website.

The project uses REUSE for exact license annotations for every file as some of them have a different license.