Skip to content

Commit

Permalink
Merge pull request #430 from numtide/fix/miscellaneous
Browse files Browse the repository at this point in the history
fix/miscellaneous
  • Loading branch information
brianmcgee authored Oct 9, 2024
2 parents f1aeb15 + 5d3de7c commit c5f2d13
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 63 deletions.
5 changes: 0 additions & 5 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
dotenv
dotenv_if_exists .env.local

if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi

watch_file flake.nix
watch_file nix/devshell.nix

use flake
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds:
- env:
- CGO_ENABLED=0
ldflags:
- -s -w -X git.numtide.com/numtide/treefmt/build.Version=v{{.Version}}
- -s -w -X github.com/numtide/treefmt/build.Version=v{{.Version}}
goos:
- linux
- darwin
Expand Down
6 changes: 3 additions & 3 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"runtime"
"time"

"git.numtide.com/numtide/treefmt/stats"
"github.com/numtide/treefmt/stats"

"git.numtide.com/numtide/treefmt/format"
"git.numtide.com/numtide/treefmt/walk"
"github.com/numtide/treefmt/format"
"github.com/numtide/treefmt/walk"

"github.com/charmbracelet/log"

Expand Down
4 changes: 2 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (

"github.com/gobwas/glob"

"git.numtide.com/numtide/treefmt/format"
"git.numtide.com/numtide/treefmt/walk"
"github.com/alecthomas/kong"
"github.com/charmbracelet/log"
"github.com/numtide/treefmt/format"
"github.com/numtide/treefmt/walk"
)

func New() *Format {
Expand Down
10 changes: 5 additions & 5 deletions cli/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (
"syscall"
"time"

"git.numtide.com/numtide/treefmt/format"
"git.numtide.com/numtide/treefmt/stats"
"github.com/numtide/treefmt/format"
"github.com/numtide/treefmt/stats"
"mvdan.cc/sh/v3/expand"

"git.numtide.com/numtide/treefmt/cache"
"git.numtide.com/numtide/treefmt/config"
"git.numtide.com/numtide/treefmt/walk"
"github.com/numtide/treefmt/cache"
"github.com/numtide/treefmt/config"
"github.com/numtide/treefmt/walk"

"github.com/charmbracelet/log"
"golang.org/x/sync/errgroup"
Expand Down
6 changes: 3 additions & 3 deletions cli/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"testing"
"time"

"git.numtide.com/numtide/treefmt/config"
"git.numtide.com/numtide/treefmt/format"
"git.numtide.com/numtide/treefmt/test"
"github.com/numtide/treefmt/config"
"github.com/numtide/treefmt/format"
"github.com/numtide/treefmt/test"

"github.com/go-git/go-billy/v5/osfs"
"github.com/go-git/go-git/v5"
Expand Down
4 changes: 2 additions & 2 deletions cli/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/charmbracelet/log"

"git.numtide.com/numtide/treefmt/stats"
"github.com/numtide/treefmt/stats"

"git.numtide.com/numtide/treefmt/test"
"github.com/numtide/treefmt/test"

"github.com/alecthomas/kong"
"github.com/stretchr/testify/require"
Expand Down
4 changes: 2 additions & 2 deletions format/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os/exec"
"time"

"git.numtide.com/numtide/treefmt/config"
"git.numtide.com/numtide/treefmt/walk"
"github.com/numtide/treefmt/config"
"github.com/numtide/treefmt/walk"

"github.com/charmbracelet/log"
"github.com/gobwas/glob"
Expand Down
2 changes: 1 addition & 1 deletion format/glob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package format_test
import (
"testing"

"git.numtide.com/numtide/treefmt/format"
"github.com/numtide/treefmt/format"

"github.com/gobwas/glob"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion format/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"cmp"
"slices"

"git.numtide.com/numtide/treefmt/walk"
"github.com/numtide/treefmt/walk"
)

type Task struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module git.numtide.com/numtide/treefmt
module github.com/numtide/treefmt

go 1.22

Expand Down
2 changes: 1 addition & 1 deletion init.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# One CLI to format the code tree - https://git.numtide.com/numtide/treefmt
# One CLI to format the code tree - https://github.com/numtide/treefmt

[formatter.mylanguage]
# Formatter to run
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"os"

"git.numtide.com/numtide/treefmt/build"
"git.numtide.com/numtide/treefmt/cli"
"github.com/alecthomas/kong"
"github.com/numtide/treefmt/build"
"github.com/numtide/treefmt/cli"
)

// We embed the sample toml file for use with the init flag.
Expand Down
27 changes: 1 addition & 26 deletions nix/devshells/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,8 @@ perSystem.self.treefmt.overrideAttrs (old: {
pkgs.delve
pkgs.pprof
pkgs.graphviz
pkgs.nodejs
]
++
# include formatters for development and testing
(import ../packages/treefmt/formatters.nix pkgs)
# docs related helpers
++ (let
docs = command:
pkgs.writeShellApplication {
name = "docs:${command}";
runtimeInputs = [pkgs.nodejs];
text = ''cd "''${DIRENV_DIR:1}/docs" && npm ci && npm run ${command}'';
};
in [
(docs "dev")
(docs "build")
(docs "preview")
(pkgs.writeShellApplication {
name = "vhs";
runtimeInputs =
[
perSystem.self.treefmt
pkgs.rsync
pkgs.vhs
]
++ (import ../packages/treefmt/formatters.nix pkgs);
text = ''vhs "$@"'';
})
]);
(import ../packages/treefmt/formatters.nix pkgs);
})
30 changes: 30 additions & 0 deletions nix/devshells/docs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
pkgs,
perSystem,
...
}:
pkgs.mkShellNoCC {
packages = let
docs = command:
pkgs.writeShellApplication {
name = "docs:${command}";
runtimeInputs = [pkgs.nodejs];
text = ''cd "''${DIRENV_DIR:1}/docs" && npm ci && npm run ${command}'';
};
in [
(docs "dev")
(docs "build")
(docs "preview")
(pkgs.writeShellApplication {
name = "vhs";
runtimeInputs =
[
perSystem.self.treefmt
pkgs.rsync
pkgs.vhs
]
++ (import ../packages/treefmt/formatters.nix pkgs);
text = ''vhs "$@"'';
})
];
}
3 changes: 0 additions & 3 deletions nix/formatter.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
pkgs,
inputs,
perSystem,
...
}:
inputs.treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix";

package = perSystem.self.treefmt;

programs = {
alejandra.enable = true;
deadnix.enable = true;
Expand Down
6 changes: 3 additions & 3 deletions nix/packages/treefmt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ in
ldflags = [
"-s"
"-w"
"-X git.numtide.com/numtide/treefmt/build.Name=${pname}"
"-X git.numtide.com/numtide/treefmt/build.Version=v${version}"
"-X github.com/numtide/treefmt/build.Name=${pname}"
"-X github.com/numtide/treefmt/build.Version=v${version}"
];

nativeBuildInputs =
Expand All @@ -57,7 +57,7 @@ in

meta = with lib; {
description = "treefmt: one CLI to format your repo";
homepage = "https://git.numtide.com/numtide/treefmt";
homepage = "https://github.com/numtide/treefmt";
license = licenses.mit;
mainProgram = "treefmt";
};
Expand Down
2 changes: 1 addition & 1 deletion test/temp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"git.numtide.com/numtide/treefmt/config"
"github.com/numtide/treefmt/config"

"github.com/BurntSushi/toml"
cp "github.com/otiai10/copy"
Expand Down
2 changes: 1 addition & 1 deletion walk/filesystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

"git.numtide.com/numtide/treefmt/test"
"github.com/numtide/treefmt/test"
"github.com/stretchr/testify/require"
)

Expand Down

0 comments on commit c5f2d13

Please sign in to comment.