Skip to content

Add decoupled lint/format tooling to the Python and TypeScript SDKs - #23

Merged
rowantrollope merged 1 commit into
redis:mainfrom
zechengz:sdk-lint-tooling
Jun 23, 2026
Merged

rowantrollope merged 1 commit into
redis:mainfrom
zechengz:sdk-lint-tooling

Conversation

@zechengz

@zechengz zechengz commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Neither SDK had a linter or formatter. This adds per-package tooling, kept decoupled so each language uses its native ecosystem. Enforcement is via CI; both SDKs declare their dev tooling so versions are reproducible. No git hooks are installed — linting runs in CI and on demand.

Python (sdk/python)

  • Ruff for lint + format. [tool.ruff] in pyproject.toml: line-length 120, target py310, rules E/F/I/UP, with F401 ignored for __init__.py re-exports.
  • Dev tooling declared as the [dev] optional-dependencies extra (ruff, pre-commit), pinned to match the pre-commit config and CI.
  • sdk/python/.pre-commit-config.yaml (opt-in), scoped to sdk/python.
  • Applied ruff check --fix and ruff format to the existing source.

TypeScript (sdk/typescript)

  • ESLint (flat config, typescript-eslint) + Prettier (printWidth: 120, chosen to match existing style — near-zero churn), declared as devDependencies.
  • lint / lint:fix / format / format:check scripts.
  • Removed one unused import.

CI

  • python-sdk.yml: new lint job installs .[dev] and runs ruff check + ruff format --check.
  • typescript-sdk.yml: new lint job runs npm run lint + npm run format:check.

Notes

The two SDKs are intentionally independent — Python uses the pre-commit framework (opt-in), TypeScript uses npm scripts. There is no shared root config and no repo-wide git hook. CI is the enforcement point.

Verification

  • Python: ruff check clean, ruff format --check clean, 39 tests pass.
  • TypeScript: npm run lint clean, npm run format:check clean, build + 5 tests pass.

Neither SDK had a linter or formatter. Add per-package tooling, kept
independent so each language uses its native ecosystem. Enforcement is via
CI; both SDKs declare their dev tooling so versions are reproducible.

Python (sdk/python):
- Ruff for lint + format; [tool.ruff] in pyproject (line-length 120,
  target py310, E/F/I/UP, __init__ re-export F401 ignored).
- Dev tooling declared as the [dev] optional-dependencies extra
  (ruff, pre-commit), pinned to match .pre-commit-config.yaml.
- sdk/python/.pre-commit-config.yaml scoped to sdk/python (opt-in).
- Apply ruff check --fix and ruff format to the existing source.

TypeScript (sdk/typescript):
- ESLint (flat config, typescript-eslint) + Prettier (printWidth 120),
  declared as devDependencies.
- lint/lint:fix/format/format:check scripts; drop one unused import.

CI:
- python-sdk.yml: new lint job installs .[dev] and runs ruff check +
  ruff format --check.
- typescript-sdk.yml: new lint job runs npm run lint + format:check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zechengz
zechengz marked this pull request as ready for review June 21, 2026 09:52
@rowantrollope
rowantrollope merged commit 990b8eb into redis:main Jun 23, 2026
14 checks passed
@rowantrollope

Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

@zechengz
zechengz deleted the sdk-lint-tooling branch June 23, 2026 00:42
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