Thank you for your interest in contributing to QRScan. This document explains how to get started, what the coding standards are, and how the review process works.
- Code of conduct
- How to contribute
- Branch model
- Code standards
- Commit messages
- Pull request process
- Issue reporting
- Platform-specific notes
This project follows a simple rule: be respectful. Harassment, discrimination, and hostile behavior of any kind will result in a ban. Constructive criticism of code is always welcome; personal attacks are not.
- Fork the repository on GitHub.
- Clone your fork locally.
- Create a branch off
developusing the naming conventions below. - Make your changes, following the code standards in this document.
- Push your branch and open a pull request targeting
develop. - Wait for CI to pass and for a maintainer review.
| Branch pattern | Purpose |
|---|---|
main |
Stable, released code. Protected. Only hotfixes and release merges land here. |
develop |
Integration branch. All feature and fix PRs target this branch. |
feature/<short-name> |
New feature work. Branch off develop. |
fix/<issue-number>-<short-name> |
Bug fixes. Branch off develop (or main for hotfixes). |
docs/<short-name> |
Documentation-only changes. |
ci/<short-name> |
CI/CD workflow changes. |
refactor/<short-name> |
Refactoring with no functional change. |
Examples:
feature/zoom-slider
fix/42-crash-on-galaxy-s3
docs/update-building-instructions
ci/add-sonarqube
- No comments in code. The code must be self-documenting through precise naming. Variable names, function names, and type names must fully communicate intent.
- No placeholder code. Do not commit
TODO,FIXME,// stub, orthrow NotImplementedError. Every method must be fully implemented or the PR must not be merged. - No dead code. Remove unused variables, functions, and imports before opening a PR.
- Explicit is better than implicit. Prefer verbose, unambiguous names over short abbreviations.
- Production-quality output only. Code should be in a state that could ship immediately.
- Kotlin only. No new Java files in the modern Android workspace.
- Jetpack Compose for all UI. No XML layouts except where strictly required (e.g. adaptive icons).
- Follow the Kotlin coding conventions.
ktlintmust pass with zero violations (./gradlew ktlintCheck).- Android Lint must pass with zero errors (
./gradlew lint). - All
suspendfunctions must be called from aCoroutineScopeor anothersuspendfunction. Do not useGlobalScope. - Use
StateFlowandcollectAsStatefor reactive state in ViewModels. - All database operations use Room DAO. No raw SQL in UI layers.
- Java only, source and target compatibility set to Java 7.
- No lambdas (API < 26 without desugaring enabled).
- No try-with-resources (API < 19 without desugaring).
- All camera operations must run off the main thread. Use a
HandlerThreadorThread. - Respect
minSdkVersion 7. Do not call any API introduced after API 7 without a version guard.
- Swift only for the
ios/workspace. - SwiftUI for all views. No UIKit unless wrapping a third-party component via
UIViewRepresentable. - SwiftLint must pass with zero errors (
swiftlint lint --strict). - Use
async/awaitfor asynchronous code. No callback-based concurrency unless wrapping a legacy API. - Use
@MainActorfor all UI-bound types. - Avoid force-unwraps (
!). Useguard let,if let, or??.
- Objective-C only.
- Manual reference counting (MRC). ARC is disabled for all files in this workspace.
- All
deallocmethods must call[super dealloc]as the final statement. - Do not use blocks (closures). The deployment target is iPhoneOS 2.0; blocks require iOS 4.0.
- Use
dispatch_asynconly where iOS 4+ is the actual deployment target. On iOS 2–3 useNSThread.
- Java 1.4 source compatibility strictly enforced.
- No generics (Java 1.4 does not support generics).
- Use raw
Vector,Hashtable, andEnumerationinstead ofArrayList,HashMap, andIterator. - All UI operations must run on the event thread via
UiApplication.getUiApplication().invokeLater().
- C++03 compatible. The Bada SDK does not support C++11.
- Use
Osp::Base::Stringfor all string operations; avoid rawchar*except for interop. - Handle all
resultreturn codes. Do not silently ignore errors. - Memory: use
new/deleteand explicitly handle ownership in destructors.
- Use Symbian C++ idioms: two-phase construction (
NewL/ConstructL), Cleanup Stack (CleanupStack::PushL/Pop),TRAP/TRAPDfor leave handling. - Never call a leaving function from a destructor.
- Follow Symbian naming conventions:
Cprefix for heap-allocated classes,Tfor POD,Mfor mixins,Rfor resource classes.
- C99 standard strictly enforced.
- Use GLib types (
gchar,gint,gboolean, etc.) consistently throughout. - Every
GObjectsubclass must implementfinalizeordisposeif it holds resources. - Use
g_signal_connectfor all event wiring. Never use direct function pointers where a signal exists. - All allocations through GLib (
g_malloc,g_new,g_strdup, etc.). Free with the corresponding GLib free function. cppcheckandclang-tidymust report zero errors.
Follow the Conventional Commits specification:
<type>(<scope>): <short description>
[optional body]
[optional footer(s)]
Types:
| Type | When to use |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code change with no functional difference |
docs |
Documentation only |
ci |
CI/CD workflow changes |
test |
Adding or fixing tests |
chore |
Dependency bumps, formatting, tooling |
perf |
Performance improvement |
revert |
Reverts a previous commit |
Scopes: android, android-legacy, ios, iphoneos, blackberry, bada, symbian, postmarketos, ci, docs, root
Examples:
feat(android): add pinch-to-zoom gesture on scanner
fix(ios): fix crash when picking image with HEIC format
ci(deps): bump actions/checkout from 3 to 4
docs: add Symbian build prerequisites table
chore(android): update ZXing to 3.5.3
- Ensure all CI checks pass before requesting review.
- Fill in the pull request template completely.
- Link the PR to any related issues using
Closes #NorFixes #Nin the description. - Keep PRs focused. One feature or fix per PR. Large refactors should be discussed in an issue first.
- Squash fixup commits before merge (the maintainer may do this on merge with squash-merge).
- Do not force-push to a PR branch after a review has started unless resolving a specific review comment.
Use the GitHub issue templates:
- Bug report — for crashes, incorrect behavior, or broken builds.
- Feature request — for new capabilities or platform support.
When filing a bug, always specify:
- Platform and OS version
- Device model
- QRScan version
- Steps to reproduce
- Expected vs. actual behavior
- Logs or crash output if available
If you want to add support for a platform not currently in the repository (e.g. Windows Mobile, Palm OS, MeeGo):
- Create a new top-level directory named after the platform (lowercase, hyphen-separated).
- Add the workspace to the relevant CI workflows in
.github/workflows/. - Update
.gitignoreand.gitattributesfor any new build artifacts. - Add a section to
docs/BUILDING.mdfor the new platform. - Update the feature comparison table in
README.md.
New code must not raise the minimum supported OS version for any existing platform without a discussion and a clear justification in the issue tracker.