Skip to content

Adopt Ruff, add Snyk scan and remove Codacy - #243

Merged
jguz-pubnub merged 18 commits into
masterfrom
python-ruff
Nov 23, 2026
Merged

jguz-pubnub merged 18 commits into
masterfrom
python-ruff

Conversation

@jguz-pubnub

@jguz-pubnub jguz-pubnub commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

ci: replaces flake8 and Codacy with Ruff, and adds a dependency vulnerability scan

jguz-pubnub and others added 6 commits November 18, 2026 11:52
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jguz-pubnub
jguz-pubnub requested a review from parfeon as a code owner November 18, 2026 11:08
@pubnub-snyk-universal-prd

pubnub-snyk-universal-prd Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

jguz-pubnub and others added 3 commits November 18, 2026 12:15
Formatting the legacy codebase should be done in a separate PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
flake8 --exclude=scripts/,src/,.cache,.git,.idea,.tox,._trial_temp/,venv/ --ignore F811,E402
- name: Install Ruff
run: pip3 install --user "ruff>=0.8"
- name: Ruff lint

@jguz-pubnub jguz-pubnub Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff replaces flake8 (and Codacy) for linting; the rules mirror the previous flake8 setup. Also, ruff format is intentionally not enforced because the legacy codebase is not ruff-formatted. The estimated scope is ~280 of ~360 files, ~17k changed lines. Therefore, formatting it here would bury functional changes and break git blame. This should be done in a separate, formatting-only PR.

jguz-pubnub and others added 2 commits November 18, 2026 12:51
…d Snyk scan

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jguz-pubnub jguz-pubnub changed the title Adopt Ruff and remove Codacy Adopt Ruff, add Snyk scan and remove Codacy Nov 18, 2026
jguz-pubnub and others added 5 commits November 18, 2026 13:02
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Enable bugbear, Pylint, simplify and McCabe rule sets with a baseline
ignore list for existing violations and noisy Pylint design metrics.
Stop excluding tests to match the previous flake8 setup, limiting them
to E, F and W, and remove a redundant urllib import.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread ruff.toml
]

[lint.mccabe]
max-complexity = 25

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the highest value is 25. This should be lowered over time as an SDK is refactored or improved.

@parfeon parfeon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jguz-pubnub
jguz-pubnub merged commit 0e1da70 into master Nov 23, 2026
13 checks passed
@jguz-pubnub
jguz-pubnub deleted the python-ruff branch November 23, 2026 17:01
techwritermat added a commit that referenced this pull request Nov 24, 2026
Take master's Ruff setup (#243) for the validations workflow and the lint
command, and restore the cross-workflow cancel step in the Tests workflow, so
the only differences from master outside tests/live are the live tier's own
files. The test command keeps --ignore=tests/live/ because the live tier needs
keys and runs in its own workflow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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