Thank you for your interest in contributing. Bug reports, suggestions and pull requests are welcome.
Be respectful, inclusive and constructive.
- macOS 14 or later
- Xcode 16 or later (Swift 6 toolchain); CI uses Xcode 16.4
- Git
git clone https://github.com/Codifya/MacOptimizer.git
cd MacOptimizer
swift build # debug build
swift test # run the test suite
./Scripts/build_app.sh # build MacOptimizer.app (unsigned)- Safety first. Every file removal must go through
SafeOperationExecutorwith aCleaningPlanthe user has reviewed and confirmed. Never callFileManager.removeItemortrashItemdirectly from a feature. - No shell. Run external tools through
SandboxedCommandRunner(add the absolute path toApprovedExecutable) orSystemCommandRunnerwith an argument array. Never build a shell command string, and never pass remote data as a command. - Swift concurrency. Use
async/awaitand actors. Keep blocking file I/O off the cooperative thread pool (seerunBlocking), and make long scans cancellable. - Native APIs first. Prefer Darwin, IOKit,
FileManagerandProcessInfoover spawning processes. - Localization. User-facing strings go through
L10nwith English and Turkish entries. See docs/LOCALIZATION.md. CLI output stays English. - No secrets in code. API keys go through
KeychainManager. - Honest results. Report the real outcome of an operation (exit codes, bytes actually freed). Do not show success for work that did not happen.
-
New features and policy changes need tests in
Tests/MacOptimizerTests/. -
Tests must be hermetic: they must not change the machine they run on. Use temporary directories, a fake home folder, injected command runners and throwaway Keychain items. CI checks that the clipboard and Keychain are unchanged after the run.
-
Run the suite before opening a pull request:
swift test
- Fork the repository and create a descriptive branch.
- Use Conventional Commits (
feat:,fix:,refactor:,docs:,test:). - Make sure
swift buildandswift testpass. - Open a pull request against
mainwith a summary of the change, the motivation and how you tested it. Keep the documentation in line with what the code does.
Security problems: please follow SECURITY.md instead of opening a public issue.