identity

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package identity owns the canonical no-slop names and their compatibility aliases. Keep identity resolution centralized so old and new spellings can never select different state silently.

Index

Constants

View Source
const (
	CommandName       = "no-slop"
	LegacyCommandName = "no-mistakes"
	ShortName         = "ns"
	LegacyShortName   = "nm"

	HomeEnv       = "NS_HOME"
	LegacyHomeEnv = "NM_HOME"

	AllowDefaultRootInTestsEnv       = "NS_ALLOW_DEFAULT_ROOT_IN_TESTS"
	LegacyAllowDefaultRootInTestsEnv = "NO_MISTAKES_ALLOW_DEFAULT_ROOT_IN_TESTS"

	RepoConfigName       = ".no-slop.yaml"
	LegacyRepoConfigName = ".no-mistakes.yaml"

	// The physical state directory deliberately remains at the legacy path for
	// this compatibility stage. A later, separately coordinated rollout owns
	// moving it.
	DefaultStateDir = ".no-mistakes"
)

Variables

This section is empty.

Functions

func EnvEnabled

func EnvEnabled(canonical, legacy string) (bool, error)

EnvEnabled reports whether either spelling of a boolean marker is exactly 1. Conflicting spellings are rejected by LookupEnv.

func LookupEnv

func LookupEnv(canonical, legacy string) (string, error)

LookupEnv resolves one logical setting from its canonical and legacy names. Equal duplicate values are harmless. Different values are refused so aliases can never become two independent settings with an implicit precedence rule.

func LookupEnvSlice

func LookupEnvSlice(env []string, canonical, legacy string) (string, error)

LookupEnvSlice is LookupEnv for an explicit subprocess environment. A nil slice falls back to the process environment, matching os/exec conventions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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