# https://github.com/numtide/treefmt
# https://github.com/numtide/treefmt-nix

on-unmatched = "info"
excludes = [
  "build/**",
  "build-*/**",
  "src/build/**",
  "src/build-*/**",
  "src/cmake-build-debug/**",
  "src/Qt5-Debug/**",
  "bin/**",
  "doc/build/**",
  "stage/**",
  "parts/**",
  "secrets/**",
  "src/libraries/build-*/**",
  "src/libraries/qkeysequencewidget/**",
  "src/libraries/qttoolbareditor/**",
  "src/libraries/qtcsv/**",
  "src/libraries/md4c/**",
  "src/libraries/qhotkey/**",
]

[formatter.clang-format]
command = "clang-format"
options = ["-i"]
includes = ["*.cpp", "*.h"]
excludes = [
  "src/libraries/diff_match_patch/**", # Library was broken by clang-format
]

[formatter.prettier]
command = "prettier"
options = ["--write"]
includes = ["webpage/**/*.vue", "webpage/**/*.js", "*.md", "*.yaml", "*.yml"]

[formatter.shfmt]
command = "shfmt"
excludes = []
includes = ["*.sh", "*.bash", "*.envrc", "*.envrc.*"]
options = ["-s", "-w", "-i", "2"]

[formatter.just]
command = "just"
includes = ["*.just"]

[formatter.taplo]
command = "taplo"
includes = ["*.toml"]
options = ["format"]

[formatter.nixfmt-rfc-style]
command = "nixfmt"
excludes = []
includes = ["*.nix"]
options = []

[formatter.cmake-format]
command = "cmake-format"
includes = ["**/*.cmake", "**/CMakeLists.txt"]
options = ["--in-place"]
