projectconfig

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = ".makeslop.yaml"

Filename is the project-local config file name, relative to the project root.

Variables

View Source
var Stub = renderStub(Cache{Content: true, Agent: true})

Stub is the content Scaffold writes for the default Cache{true,true}. It seeds the default scan filters as active values so new projects get secret masking out of the box.

Functions

func Load

func Load(root string) (Excludes, Cache, []string, error)

Load parses <root>/.makeslop.yaml. The four-value return is:

  • Excludes: file/dir masks and scan patterns. Excludes.Warnings carries human-readable notices for symlinked entries (dropped with a warning); missing entries and non-symlink wrong-type drops stay silent.
  • Cache: per-workspace overlay settings; defaults to {true,true} when the cache: block (or the whole file) is absent.
  • []string: sorted "KEY=VALUE" env pairs from environments:; nil when the block is absent (nil ≡ no env injection, backward-compatible).
  • error: any parse, validation, or filesystem error, wrapped "projectconfig: ".

The file at root/.makeslop.yaml must be a regular file. A symlink — dangling or live — is rejected with a hard error: masking and sandbox-policy behaviour depend on the file being a real file on disk.

root must be absolute and EvalSymlinks-evaluated.

func Scaffold

func Scaffold(root string, c Cache) error

Scaffold creates <root>/.makeslop.yaml with the stub for the given Cache defaults. Idempotent: EEXIST on a regular file is success and user edits are never clobbered (c is a no-op on an existing file). A symlink at the path — dangling or live — is rejected with a hard error: the project config must be a regular file so ProtectProjectConfig and Load behave predictably. root must be absolute and EvalSymlinks-evaluated.

Types

type Cache added in v0.0.4

type Cache struct {
	Content bool // mount per-workspace cache docs/ + CLAUDE.md (default true)
	Agent   bool // mount per-workspace cache .claude/ + .codex/ (default true)
}

Cache is the parsed cache-overlay configuration. Both fields default to true when the cache: block is absent (backward-compatible).

type Excludes

type Excludes struct {
	Files    []string // absolute host paths; /dev/null overlay targets
	Dirs     []string // absolute host paths; tmpfs overlay targets
	Patterns []string // basename globs for the WalkDir secret scan; deduped and sorted
	SkipDirs []string // bare directory names pruned during the WalkDir scan; deduped and sorted
	Warnings []string // human-readable notices about dropped entries (e.g. symlinks); callers should surface these
}

Excludes is the parsed, validated, host-resolved result of Load. Paths are absolute, under root, deduplicated within each list, and sorted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL