Skip to content

feat(tools): add Python linter script with pytest wrapper#1

Draft
duhow with Copilot wants to merge 3 commits into
mainfrom
copilot/add-python-linter-script
Draft

feat(tools): add Python linter script with pytest wrapper#1
duhow with Copilot wants to merge 3 commits into
mainfrom
copilot/add-python-linter-script

Conversation

Copilot AI commented Apr 5, 2026

Copy link
Copy Markdown

Summary

Adds tools/lint.py, a single-file Python linter for the Android project that runs as a final validation step before merging.

Checks performed

Check Description
XML validity All app/src/main/res/**/*.xml files parse without error
Language parity Every values-XX/strings.xml contains the same keys as the base values/strings.xml
Language arrays language_codes and language_names in arrays.xml have the same item count; non-default codes appear in locale_config.xml
Bracket balance (), {}, [] are balanced in Kotlin/Java source files (strips strings and comments before counting)

Usage

# standalone (exit code = number of failed checks)
python tools/lint.py

# allow up to 3 failures without breaking CI
python tools/lint.py --max-warns 3

# strict mode — extra translation keys are also errors
python tools/lint.py --pedantic

# skip pytest even if installed
python tools/lint.py --no-pytest

When pytest is installed and no special flags are passed, the script delegates to pytest (standard exit codes). Otherwise the built-in standalone runner is used (exit code = failed check count, capped at 125).

Changes

  • tools/lint.py — new linter script (argparse, no click; pytest-compatible test_* functions + standalone runner)
  • AGENTS.md — new Linting section added after Development best practices, with instructions to run as final step
  • .github/workflows/build.ymlRun linter step added before the build
  • .github/workflows/release.ymlRun linter step added before the build
  • fastlane/metadata/android/en-US/changelogs/1.txt — updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants