{"id":18972282,"url":"https://github.com/eliaperantoni/enumero","last_synced_at":"2026-04-16T15:32:11.272Z","repository":{"id":57535623,"uuid":"282235418","full_name":"eliaperantoni/enumero","owner":"eliaperantoni","description":"A little tool to generate namespaced, type-checked and polyglot enums in Go.","archived":false,"fork":false,"pushed_at":"2022-01-17T08:26:27.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T12:02:33.844Z","etag":null,"topics":["code-generation","enum","golang","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliaperantoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-24T14:05:30.000Z","updated_at":"2024-03-22T16:29:05.000Z","dependencies_parsed_at":"2022-08-29T00:41:00.564Z","dependency_job_id":null,"html_url":"https://github.com/eliaperantoni/enumero","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/eliaperantoni/enumero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliaperantoni%2Fenumero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliaperantoni%2Fenumero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliaperantoni%2Fenumero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliaperantoni%2Fenumero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliaperantoni","download_url":"https://codeload.github.com/eliaperantoni/enumero/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliaperantoni%2Fenumero/sbom","scorecard":{"id":372526,"data":{"date":"2025-08-11","repo":{"name":"github.com/eliaperantoni/enumero","commit":"e66cf43c983fbf3ba47a0defd7ceafbf18b401fb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T13:19:38.058Z","repository_id":57535623,"created_at":"2025-08-18T13:19:38.068Z","updated_at":"2025-08-18T13:19:38.068Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31892155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","enum","golang","tool"],"created_at":"2024-11-08T15:07:46.954Z","updated_at":"2026-04-16T15:32:11.249Z","avatar_url":"https://github.com/eliaperantoni.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enumero\nA little tool to generate namespaced, type-checked and polyglot enums in Go.\n\n## Installation\n```shell\n$ go get github.com/eliaperantoni/enumero\n```\n\n## Usage\n```shell\n$ enumero --help\nUsage of enumero:\n  -logrus\n        use logrus.Fatal instead of panic\n  -marshalJSON\n        generate implementation for json.Marshaler\n  -marshalText\n        generate implementation for encoding.TextMarshaler\n  -name string\n        name of the enum (default \"Enum\")\n  -output string\n        output file path (default \"./%s_enumero.go\")\n  -package string\n        name of the generated package (default \"enums\")\n  -source string\n        source file to use for values and variants\n  -unmarshalJSON\n        generate implementation for json.Unmarshaler\n  -unmarshalText\n        generate implementation for encoding.TextUnmarshaler\n  -values string\n        values comma separated\n  -variant value\n        VariantName:Value1,Value2,...,VariantN\n```\n\n```shell\n$ enumero -package=main -name Color -values=Red,Green,Blue -variant=German:Rot,Grün,Blau\n```\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar color ColorT\n\tcolor = Color.Blue\n\n\tfmt.Println(color.String())\n\t// Ordinal number assigned to enum value, starting from 1\n\tfmt.Println(color.Ordinal())\n\tfmt.Println(color.German())\n\n\t// Iterate enum values\n\tfor i, color := range Color.Values {\n\t\tfmt.Printf(\"%d: [%d] %s %s\\n\", i, color.Ordinal(), color.String(), color.German())\n\t}\n\n\t// Returns non-nil error if string doesn't belong to any value\n\tif color, err := Color.FromString(\"Green\"); err == nil {\n\t\tfmt.Println(color.String())\n\t} else {\n\t\tlog.Fatal(\"invalid color\")\n\t}\n\n\t// Returns no error, panics on failure\n\tcolor = Color.MustFromOrdinal(1)\n\tfmt.Println(color.German())\n\n\tcolor = Color.MustFromGerman(\"Blau\")\n\tfmt.Println(color.String())\n}\n\n```\n\n```shell\n$ go run color_enumero.go test.go \nBlue\n3\nBlau\n0: [1] Red Rot\n1: [2] Green Grün\n2: [3] Blue Blau\nGreen\nRot\nBlue\n```\n\n### Source\nFor very big enums, a source file can be provided instead of listing all values and variants.\n\nIt is expected to look like this:\n\n```\n,German\nRed,Rot\nGreen,Grün\nBlue,Blau\n```\n\nThat is: the first line is the header and contains an empty string (marking the column of primary values) followed by\nthe names of the variants.\n\nEach following line contains a single value and its corresponding variants.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliaperantoni%2Fenumero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliaperantoni%2Fenumero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliaperantoni%2Fenumero/lists"}