{"id":23391370,"url":"https://github.com/fengalin/fix-getters","last_synced_at":"2025-10-14T01:14:39.037Z","repository":{"id":57630139,"uuid":"316066045","full_name":"fengalin/fix-getters","owner":"fengalin","description":"Automatically remove the `get` prefix from getters and deal with functions returning exactly one `bool`.","archived":false,"fork":false,"pushed_at":"2021-05-31T09:55:40.000Z","size":300,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-01T18:43:50.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fengalin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-25T22:20:39.000Z","updated_at":"2021-05-31T09:51:12.000Z","dependencies_parsed_at":"2022-09-26T20:11:16.926Z","dependency_job_id":null,"html_url":"https://github.com/fengalin/fix-getters","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fengalin/fix-getters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengalin%2Ffix-getters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengalin%2Ffix-getters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengalin%2Ffix-getters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengalin%2Ffix-getters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fengalin","download_url":"https://codeload.github.com/fengalin/fix-getters/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengalin%2Ffix-getters/sbom","scorecard":{"id":396727,"data":{"date":"2025-08-11","repo":{"name":"github.com/fengalin/fix-getters","commit":"67f4a5cb822925db866e53f4d507f667871bf2d7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/CI.yml:1","Info: no jobLevel write permissions found"],"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":10,"reason":"no dangerous workflow patterns detected","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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/CI.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/fengalin/fix-getters/CI.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/CI.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/fengalin/fix-getters/CI.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"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 'main'"],"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":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2021-0139","Warn: Project is vulnerable to: RUSTSEC-2021-0145 / GHSA-g98v-hv3f-hcfr","Warn: Project is vulnerable to: RUSTSEC-2024-0375","Warn: Project is vulnerable to: RUSTSEC-2020-0159","Warn: Project is vulnerable to: RUSTSEC-2022-0006 / GHSA-9hpw-r23r-xgm5","Warn: Project is vulnerable to: RUSTSEC-2020-0071 / GHSA-wcg3-cvx6-7396"],"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-18T19:11:40.729Z","repository_id":57630139,"created_at":"2025-08-18T19:11:40.730Z","updated_at":"2025-08-18T19:11:40.730Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017452,"owners_count":26086081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-22T04:16:01.174Z","updated_at":"2025-10-14T01:14:39.008Z","avatar_url":"https://github.com/fengalin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fix-getters ![CI](https://github.com/fengalin/fix-getters/workflows/CI/badge.svg) [![dependency status](https://deps.rs/repo/github/fengalin/fix-getters/status.svg)](https://deps.rs/repo/github/fengalin/fix-getters)\n\nThis repository contains crates and tools to help with the removal of the `get`\nprefix from getters in existing Rust code.\n\nRust [naming conventions for getter methods](https://doc.rust-lang.org/1.0.0/style/style/naming/README.html#getter/setter-methods-%5Brfc-344%5D)\nstipulates to use:\n\n\u003e A method `foo(\u0026self) -\u003e \u0026T` for getting the current value of the field.\n\nAttempts at removing the `get` prefix automatically or manually proved to be\nsuboptimal with large code bases:\n\n* Some `get_*` functions actually perform some sort of computation, so we can't\n  exactly consider they return the current value of a field.\n* Removing the `get` prefix automatically can result in invalid code.\n  Ex. `get_mut`, `get_loop`, ...\n* Getters returning a `bool` should usually use the form `is_suffix`, but\n  sometimes, we just want to conjugate a verb. E.g.: `if element.emits_eos()`.\n* Most `get_*` functions that return a `bool` and which actually perform some sort\n  of computation can still be renamed as `is_suffix`, since it makes sense in\n  expressions such as `if context_a.is_same_as(\u0026context_b)`.\n* Then it's necessary to update the getters call sites and we have to guess\n  the return type somewhat.\n\n## Get functions selection\n\nNot all `get` functions should be renamed. Besides the [`rules`](https://github.com/fengalin/fix-getters/blob/0.3.2/rules/README.md#function-name-rules)\nenforced while renaming the function, other criteria are observed before\ndeciding whether to apply the new name. `get` functions returning exactly one\n`bool` require special attention since they are usually renamed using an `is`\nprefix or a conjugated verb which make the new name suitable in expressions.\n\nBy default, all `get` functions are renamed. However, users might prefer sticking\nby the definition and only rename getters which actually return a field.\n\nThe following rules apply to `get` functions not returning exactly one `bool`.\nThey are enforced by the tools when the `conservative` mode is selected. Note\nthat this might leave behind candidates. Use this if you consider it easier to\nmanually change these candidates after the automatic pass than searching in the\nautomatic changes.\n\n* The function is a method. This excludes standalone functions or associated\n  functions.\n* The function accepts no arguments besides `\u0026['_][mut] self`. The methods which\n  accept other arguments are not `getter`s in the sense that they usually don't\n  return current value of a field. Similarly, functions consuming `self` are not\n  eligible for `get` removal.\n* The function accepts no type parameter (lifetimes are accepted). The reason is\n  the same as for functions accepting multiple arguments (see above).\n\nThese rules are implemented in the [fix-def](https://github.com/fengalin/fix-getters/tree/0.3.2/fix-def)\n\u0026 [fix-calls](https://github.com/fengalin/fix-getters/tree/0.3.2/fix-calls)\ntools and apply to regular code, macros and documentation code.\n\n## Packages\n\nThis workspace contains the following packages:\n\n* [rules](https://github.com/fengalin/fix-getters/tree/0.3.2/rules):\n  rules to apply during the update process.\n* [fix-def](https://github.com/fengalin/fix-getters/tree/0.3.2/fix-def):\n  a tool to update the `get` functions definition.\n* [fix-calls](https://github.com/fengalin/fix-getters/tree/0.3.2/fix-calls):\n  a tool to update the `get` functions call sites.\n* [utils](https://github.com/fengalin/fix-getters/tree/0.3.2/utils):\n  utilities and types common to the `fix-getters` tools.\n\n## LICENSE\n\nAll crates contained in here are licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengalin%2Ffix-getters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffengalin%2Ffix-getters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengalin%2Ffix-getters/lists"}