Files
youtube-generator/CONTRIBUTING.md
T
poli0981andClaude Opus 5.5 d7a86d581e ci(sonarcloud): switch to CI-based analysis with Vitest coverage
SonarCloud's Automatic Analysis is off. The new `sonarcloud` job in
ci.yml runs SonarSource/sonarqube-scan-action v8.3.0 after `check`, with
the LCOV report that `check` now uploads; it never installs npm packages,
so SONAR_TOKEN never shares a job with them, and it fails with the
quality gate. Fork and Dependabot PRs skip it (no repository secrets).

sonar-project.properties analyses the tests as tests, imports the
coverage and excludes from it everything Vitest does not measure. Vitest
now also measures src/config, src/store and src/utils, next to the
engine, the Worker and the build plugins. The job passes package.json's
version as sonar.projectVersion, so the "previous version" new-code
period starts again at every release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:38:24 +07:00

5.7 KiB

Contributing to YTDescGen

Thanks for taking the time to contribute. Read this once before opening your first PR — it saves time on both sides.

Code of Conduct

Participation is governed by the Code of Conduct. By contributing, you agree to its terms.

Getting Started

  1. Read the Development Guide — also available in Vietnamese.
  2. Install dependencies: npm install.
  3. Start the dev server: npm run dev.
  4. Before opening a PR, run the same gates CI runs (the required check job):
    npm run typecheck && npm run typecheck:all
    npm run lint && npm run format:check
    npm run validate:locales
    npm run test:coverage
    npm run knip
    npm run check:version && npm run check:tauri && npm run check:licenses
    npm run check:copyright
    npm run build && npm run check:bundle
    npm run cf:check
    
    check:licenses fails when THIRD_PARTY_NOTICES.md is stale — npm run generate:third-party rewrites it. check:copyright fails in the first commit of a new year — npm run update:copyright fixes it. Touched src-tauri/? Also cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings and cargo test in src-tauri/ (after npm run build — see the Development Guide).

How to Contribute

Issues

Use the templates in .github/ISSUE_TEMPLATE/:

  • Bug report — only if you can reproduce on the latest release.
  • Feature request — only with a concrete use case, not abstract requests.

Pull Requests

  • Branch from main (feat/…, fix/…, docs/…) and open the PR against main. Every merge to main deploys the web app, so main stays releasable.
  • Commit format and PR title: type(scope): message — e.g. feat(engine): add Spanish template support. Types: feat, fix, refactor, docs, test, ci, chore. CI checks the PR title.
  • Required checks: check, dependency-review, workflow-lint, reuse, pr-title. When src-tauri/ changes, the Rust workflow's lint-and-test and cargo-deny run too, and GitHub's CodeQL code scanning runs on every PR. SonarCloud analyses PRs opened from this repository — its quality gate wants A ratings, reviewed security hotspots, at most 3 % duplication and at least 80 % test coverage on new code in the layers Vitest measures (PRs from forks get no secrets and skip it; the maintainer's merge runs it on main). Commits on main are signed.
  • PR titles start with a lower-case letter after the colon (feat(editor): add …, not feat(editor): Add …).
  • One logical change per PR. Don't bundle unrelated refactors.
  • All locale files must stay in lock-step — see the i18n section below.
  • AI-assisted contributions are welcome but must be disclosed in the PR description.

i18n Contributions

If your change adds or removes any user-facing string:

  1. Update the locale schema at src/i18n/locales/_schema.json first.
  2. Add the key to all 8 locales (en / vi / ja / es / ko / zh / pt-BR / id).
  3. npm run validate:locales must pass.

Native-speaker corrections to AI-translated locales (JA / ES / KO / ZH / PT-BR / ID) are especially welcome — see DISCLAIMER.md for the current translation-quality status.

Auto-ignored Contributions

The following are closed without review and may result in a contributor ban — no exceptions:

  • Suspected malicious code. If a PR contains code we suspect may be a supply-chain attack, obfuscation, credential harvesting, cryptominer, or any form of malware — even if CodeQL and Dependabot don't flag it, the maintainer may investigate manually. Detection equals ban.
  • Unverified or suspicious links in issues, PRs, or comments (pastebin scrapers, redirect chains, unfamiliar shortlinks, link-shortener URLs without context).
  • Behavior or language violating GitHub's Acceptable Use Policies.
  • Off-topic / rambling reports that don't get to the point. Example of what gets ignored: "Good morning, today is a beautiful day, I was just wondering if maybe…" — get straight to the problem.
  • PRs that touch hundreds of files for a one-line fix (typical sign of an auto-formatter run on unrelated files).
  • Tests deleted or skipped to make CI pass.
  • "AI rewrote my entire codebase in a different style" PRs. AI-assisted edits are welcome (disclosed); whole-repo rewrites are not.
  • Spam, drive-by typo fixes that don't address a real issue, and karma-farming PRs.

What We Want

  • Bug fixes with a reproduction case and a regression test.
  • Locale corrections from native speakers.
  • New content-warning or tech-note IDs with all 8 translations and a clear rationale (especially horror-genre vocabulary) — the checks fail until every locale has its label and description line.
  • New video types or genres that fit the gameplay no-commentary use case.
  • Accessibility and mobile-responsive improvements.
  • Performance fixes with a before/after measurement.

What We Don't Want

  • Cosmetic refactors with no behavior change.
  • Adding new runtime dependencies without first opening an issue to discuss the tradeoff.
  • Renaming files without coordinating with open PRs.
  • Changes to the LICENSE or NOTICE files (these are governance, not contributions).

Contact

Questions about contributing or conduct: code@poli0981.dev. Security issues go through SECURITY.md, never a public issue.

License

By contributing, you agree your contribution will be licensed under the Apache License 2.0, the same license as the project, and that you have the right to grant that license.