Skip to content

chore: adopt the standard pre-commit, ruff, and semgrep toolchain (backport of #74) - #85

Merged
aakvatech merged 4 commits into
Aakvatech-Limited:version-16-hotfixfrom
av-dev2:backport-74-to-version-16-hotfix
Sep 3, 2026
Merged

chore: adopt the standard pre-commit, ruff, and semgrep toolchain (backport of #74)#85
aakvatech merged 4 commits into
Aakvatech-Limited:version-16-hotfixfrom
av-dev2:backport-74-to-version-16-hotfix

Conversation

@av-dev2

@av-dev2 av-dev2 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #74 to version-16-hotfix. The automated backport-action job failed on this branch for the same reason it failed on version-15: PR #74's lease renewal / cost-center / max-active-leases commits are already ancestors of this branch, so cherry-picking them produced empty diffs the action couldn't recover from. This PR brings over what was actually missing or outdated: the pre-commit/ruff/semgrep toolchain.

This branch already had a partial, older toolchain, which this PR replaces:

  • .pre-commit-config.yaml used an unanchored exclude: 'node_modules|.git' (breaks validation of .github/*), ruff v0.8.1 with no pre-commit/commit-msg/pre-push stage split, and no semgrep or commitlint hooks. Replaced with the standard three-stage config.
  • linter.yml was the old single-job version. Replaced with the standard blocking/non-blocking semgrep split + pip-audit.
  • pyproject.toml ruff config corrected (line-length 110, tab indent, E101/W191 ignored); frappe/erpnext bumped to >=16.0.0,<17.0.0 to match this branch.
  • Added the missing required files: commitlint.config.js, scripts/setup-git-hooks.sh, .github/workflows/pre-commit.yml, .github/workflows/semantic-commits.yml.
  • Deleted the disallowed files this branch still had: ci.yml, ci-tests.yml (both spun up a full bench and ran the Frappe test suite in CI on every PR/push -- 5-8 min per run, needs MariaDB/Redis, goes red for reasons unrelated to the diff), release.yml, .releaserc.json (semantic-release, duplicates tag-and-promote-from-pr-label.yml).
  • backport.yml and tag-and-promote-from-pr-label.yml were already current; left untouched.
  • fix: clear the semgrep and ruff findings... -- same fixes ci: adopt the standard pre-commit, ruff, and semgrep toolchain #74 made on version-15-hotfix, re-applied here.
  • style: reformat with the app ruff config -- pure formatting, no behavior change.

No branch protection rule on version-16-hotfix names a job from the deleted workflows, so nothing else needs updating.

Test plan

  • pre-commit run --all-files passes (ruff import sort, ruff lint, ruff format, frappe-semgrep-rules, commitlint)
  • ruff check propms --show-settings confirms line-length 110 / tab indent are resolved from this app's own pyproject.toml
  • grep audit confirms no remaining bench-init/get-app/install-app/migrate steps in .github/workflows/
  • push gate (full-repository-check) verified against this same push

Backport of the CI/tooling setup from PR Aakvatech-Limited#74 on version-15-hotfix.

Replaces the old unanchored-exclude .pre-commit-config.yaml (v0.8.1
ruff, no commit-msg/pre-push stages, no semgrep) and outdated
linter.yml with the standard three-stage config. Bumps the
frappe/erpnext dependency range to 16.x, matching this branch.

Deletes ci.yml (bench build in CI, disallowed), release.yml and
.releaserc.json (semantic-release duplicates tag-and-promote).
Use frappe.db.get_single_value for the four reads of Property
Management Settings in issue_hook; that doctype is a single.

Initialise invoice_item in leaseInvoiceAutoCreate so the flush
branch has a binding at the top of the loop.

Drop dead locals (foreign_currency in both rent invoice reports,
name_in_json in create_property_setter), replace explicit
positional format indices, and use 'is None' instead of '== None'
in lease.py.
Line length 110, tab indent, double quotes. No behavior change.
ci-tests.yml built a full bench, installed erpnext and propms, and
ran the Frappe test runner on every PR/push -- 5-8 minutes per run,
needs MariaDB and two Redis services, and goes red for upstream or
PyPI breakage unrelated to the diff. Frappe tests run locally only,
on the bench terminal.

No branch protection rule on this branch names a job from this
workflow, so nothing else needs updating.
@aakvatech
aakvatech merged commit aff997f into Aakvatech-Limited:version-16-hotfix Sep 3, 2026
4 checks passed
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