Documentation
¶
Index ¶
- Constants
- Variables
- func ContainsHappyConfigFile(dir string) (string, bool)
- func FindProjectDir(wd string) (dir string, found bool, err error)
- func IsProjectDir(dir string, all bool) bool
- type Config
- type DependenciesConfig
- type DependenciesGoConfig
- type DirInfo
- type GitConfig
- type LinterConfig
- type LinterGolangCILintConfig
- type Project
- func (prj *Project) Config() *settings.Profile
- func (prj *Project) Dir() DirInfo
- func (prj *Project) Dist() string
- func (prj *Project) GoModules(sess *session.Context) ([]*gomodule.Package, error)
- func (prj *Project) Lint(sess *session.Context) error
- func (prj *Project) Release(sess *session.Context, allowDirty, skipRemoteChecks bool) (err error)
- func (prj *Project) Test(sess *session.Context) error
- type ReleaserConfig
- type TestsConfig
Constants ¶
View Source
const ( ConfigFileName = ".happy.yaml" ConfigVersion = version.Version("v1.0.0") ConfigVersionMin = version.Version("v1.0.0") )
Variables ¶
Functions ¶
func ContainsHappyConfigFile ¶
ContainsHappyConfigFile reports whether dir contains the Happy config file. It returns true if the file exists and is a regular file. If the file exists, it returns the absolute path to the file.
func FindProjectDir ¶
FindProjectDir locates the root of a Happy project by ascending from wd. It looks for either:
- A directory containing the Happy config file (ConfigFileName = "happy.yml").
- A Git repository marker (via git.IsRepository).
Returns:
dir: absolute path to the discovered project root, or original wd if none found. found: true if a project root is detected; false otherwise. err: any error encountered resolving wd to an absolute path.
The search ascends parent directories until it reaches the filesystem root.
func IsProjectDir ¶
IsProjectDir reports whether dir is a Happy project root. A directory is considered a project root if it contains:
- The Happy config file (ConfigFileName = "happy.yml").
- A Git repository marker (via git.IsRepository).
It returns true if either condition is met.
Types ¶
type Config ¶
type Config struct {
Version version.Setting `key:"version,save" default:"v1.0.0"`
// Ignore defines project-relative paths that should be skipped by
// tooling such as lint and test. This mirrors the top-level
// "ignore" list in .happy.yaml.
Ignore settings.StringSlice `key:"ignore,save"`
Changelog changelog.Config `key:"changelog"`
Git GitConfig `key:"git"`
Linter LinterConfig `key:"linter"`
Releaser ReleaserConfig `key:"releaser"`
Tests TestsConfig `key:"tests"`
Dependencies DependenciesConfig `key:"deps"`
}
type DependenciesConfig ¶ added in v0.1.2
type DependenciesConfig struct {
Latest DependenciesGoConfig `key:"go"`
}
type DependenciesGoConfig ¶ added in v0.1.2
type DependenciesGoConfig struct {
Latest settings.StringSlice `key:"latest"`
}
type DirInfo ¶
type DirInfo struct {
Path string `json:"path"`
HasConfigFile bool `json:"has_config_file"`
ConfigFile string `json:"config_file"`
HappyVersion version.Version `json:"happy_version"`
Version version.Version `json:"version"`
DependsOnHappy bool `json:"depends_on_happy"`
HasGit bool `json:"has_git"`
}
type GitConfig ¶
type GitConfig struct {
CommitterName settings.String `key:"committer.name,save"`
CommitterEmail settings.String `key:"committer.email,save"`
AuthorName settings.String `key:"author.name,save"`
AuthorEmail settings.String `key:"author.email,save"`
Branch settings.String `key:"branch,save" default:"main"`
RemoteName settings.String `key:"remote.name,save" default:"origin"`
RemoteURL settings.String `key:"remote.url,save"`
}
type LinterConfig ¶
type LinterConfig struct {
Enabled settings.Bool `key:"enabled,save" default:"false"`
GolangCILint LinterGolangCILintConfig `key:"golangci-lint"`
}
type LinterGolangCILintConfig ¶
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
type ReleaserConfig ¶
type TestsConfig ¶
Click to show internal directories.
Click to hide internal directories.