Split long Rust files into focused submodules
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 363
- Forks
- 369
- Avg merge
- 1d 54m
- Merged PRs (30d)
- 59
Description
Several Rust files are very long. This makes reviewing and editing the code harder.
We should refactor the longest files into smaller submodules based on responsibility.
Examples of long files
Current examples:
src/sync/github/mod.rs- ~2,839 linessrc/sync/github/tests/mod.rs- ~1,855 linessrc/validate.rs- ~1,515 linessrc/schema.rs- ~1,117 linessrc/sync/github/api/read.rs- ~845 linessrc/sync/github/api/mod.rs- ~807 linessrc/sync/github/api/write.rs- ~764 linessrc/main.rs- ~682 linessrc/static_api.rs- ~651 lines
Example: GitHub sync module
src/sync/github/mod.rs currently contains orchestration, repo diffs, team diffs, permissions, rulesets, pages, environments, custom properties, app installations, and formatting logic.
We should only keep the orchestration part.
A possible split:
src/sync/github/
mod.rs # create_diff, SyncGitHub orchestration, shared exports
apps.rs # GithubApp, app installation state/diffs
teams.rs # team diffing, team create/update/delete logic
repos.rs # RepoDiff, CreateRepoDiff, UpdateRepoDiff
rulesets.rs # construct_ruleset, RulesetDiff, ruleset formatting
environments.rs # EnvironmentDiff
pages.rs # PagesDiff and pages formatting
custom_properties.rs # CustomPropertyDiff and value matching
api/
tests/
How to solve this issue
Open small PRs that only extract one submodule at a time.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/sync/github/mod.rs and the related files under src/sync/github/tests/ to understand the existing responsibilities and module boundaries. Choose one proposed area, such as apps, teams, or repos, and extract only that submodule. The work is done when the original module retains orchestration, behavior remains unchanged, and the relevant tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100