Changes
4 changed files (+51/-64)
-
-
@@ -111,7 +111,7 @@ G_MESSAGES_DEBUG=Plac zig build run### Code Formatting This project uses [treefmt](https://treefmt.com) as a code formatter frontend. This project uses [dprint](https://dprint.dev/) as a code formatter frontend. In addition to system dependencies, you need these formatter softwares: - dprint
-
@@ -121,9 +121,11 @@ In addition to system dependencies, you need these formatter softwares:After installing required softwares, you can format source code by: ``` treefmt dprint fmt ``` If you're using Nix, use can simply run `nix fmt` without installing anything. ### Build Flatpak bundle This project provides Zig build script for building Flatpak single-file bundle.
-
-
-
@@ -27,9 +27,31 @@"useTabs": true, "json": {}, "markdown": {}, "exec": { "cwd": "${configDir}", "commands": [ { "exts": ["zig"], "command": "zig fmt --stdin", }, { "exts": ["zon"], "command": "zig fmt --zon --stdin", }, { "exts": ["nix"], "command": "nixfmt --strict --width={{line_width}} --indent={{indent_width}}", }, { "exts": ["vala"], "command": "uncrustify -c uncrustify.cfg -l VALA", "cacheKeyFiles": ["uncrustify.cfg"], }, ], }, "plugins": [ "https://plugins.dprint.dev/json-0.20.0.wasm", "https://plugins.dprint.dev/markdown-0.18.0.wasm", "https://plugins.dprint.dev/toml-0.7.0.wasm", "https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364", ], }
-
-
-
@@ -104,6 +104,30 @@}; }; formatter = forEachSystems ( { pkgs, system }: pkgs.buildFHSEnv { name = "fhs-dprint"; targetPkgs = pkgs: with pkgs; [ # Code formatter # https://dprint.dev/ dprint # > Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA # https://uncrustify.sourceforge.net/ uncrustify # Official formatter for Nix code # https://github.com/NixOS/nixfmt nixfmt zig ]; runScript = "dprint fmt"; } ); devShells = forEachSystems ( { pkgs, system }: {
-
@@ -116,10 +140,6 @@packages = with pkgs; [ # > Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA # https://uncrustify.sourceforge.net/ uncrustify # For text editors, optional. # > ZLS is a non-official implementation of the Language Server Protocol for Zig # https://github.com/zigtools/zls
-
@@ -130,22 +150,9 @@# https://github.com/vala-lang/vala-language-server vala-language-server # Code formatter # Called by treefmt # https://dprint.dev/ dprint # Code formatter # https://github.com/numtide/treefmt treefmt # Copyright and license linter based on SPDX # https://github.com/fsfe/reuse-tool reuse # Official formatter for Nix code # https://github.com/NixOS/nixfmt nixfmt ] # Non macOS packages (not supported, broken, etc.) ++ (lib.optionals (!stdenv.isDarwin) [
-
-
treefmt.toml (deleted)
-
@@ -1,44 +0,0 @@# Copyright 2025 Shota FUJI # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 # # Configuration file for treefmt <https://treefmt.com>, formatter frontend. excludes = ["LICENSES"] [formatter.dprint] command = "dprint" options = ["fmt"] includes = ["*.md", "*.json", "*.jsonc", "*.toml"] [formatter.zig] command = "zig" options = ["fmt"] includes = ["*.zig"] [formatter.zon] command = "zig" options = ["fmt", "--zon"] includes = ["*.zon"] [formatter.vala] command = "uncrustify" options = ["-c", "uncrustify.cfg", "-l", "VALA", "--replace", "--no-backup"] includes = ["*.vala"] [formatter.nix] command = "nixfmt" options = ["--strict", "--width=100", "--indent=2"] includes = ["*.nix"]
-