Skip to content

Commit

Permalink
docs: Improve developer documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Sep 27, 2024
1 parent be2bfbf commit 222aef8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ PREFIX?=/usr/local
.PHONY: default
default: build

.PHONY: smoketest
smoketest: run build-all test lint shellcheck format
.PHONY: smoke-test
smoke-test: run build-all test lint shellcheck format

.PHONY: build
build:
Expand Down
8 changes: 4 additions & 4 deletions assets/chezmoi.io/docs/developer-guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ target state with the entry state in the persistent state.

## `internal/cmd/` directory

`internal/cmd/*cmd.go` contains the code for each individual command and
`internal/cmd/*templatefuncs.go` contain the template functions.
`internal/cmd/*cmd.go` files contain the code for each individual command.
`internal/cmd/*templatefuncs.go` files contain the template functions.

Commands are defined as methods on the `Config` struct. The `Config` struct is
large, containing all configuration values read from the config file, command
Expand All @@ -117,8 +117,8 @@ system and persistent state.

chezmoi uses separate types for absolute paths (`AbsPath`) and relative paths
(`RelPath`) to avoid errors where paths are combined (e.g. joining two absolute
paths). A further type `SourceRelPath` is a relative path within the source
directory and handles file and directory attributes.
paths is an error). The type `SourceRelPath` is a relative path within the
source directory and handles file and directory attributes.

Internally, chezmoi normalizes all paths to use forward slashes with an
optional upper-cased Windows volume so they can be compared with string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

chezmoi is designed with UNIX-style composability in mind, and the command line
tool is semantically versioned. Building on top of chezmoi should primarily be
done by executing the binary with arguments and the standard input and output
configured appropriately. The `chezmoi dump` and `chezmoi state` commands
done by executing the `chezmoi` binary with arguments and the standard input and
output configured appropriately. The `chezmoi dump` and `chezmoi state` commands
allows the inspection of chezmoi's internal state.
12 changes: 9 additions & 3 deletions assets/chezmoi.io/docs/developer-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ Run chezmoi:
$ go run .
```

Run a set of smoketests, including cross-compilation, tests, and linting:
Run a set of smoke tests, including cross-compilation, tests, and linting:

```console
$ make smoketest
$ make smoke-test
```

Test building chezmoi for all architectures:

```console
$ make test-release
```

!!! hint
Expand All @@ -57,6 +63,6 @@ $ make smoketest

```console
$ SHELL=bash make test
$ SHELL=zsh make smoketest
$ SHELL=zsh make smoke-test
$ SHELL=bash go test ./...
```

0 comments on commit 222aef8

Please sign in to comment.