Skip to content

task/WP-1256: Format server side code - #1359

Open
rstijerina wants to merge 12 commits into
mainfrom
task/WP-1256--format-server-side-code
Open

task/WP-1256: Format server side code#1359
rstijerina wants to merge 12 commits into
mainfrom
task/WP-1256--format-server-side-code

Conversation

@rstijerina

@rstijerina rstijerina commented Sep 2, 2026

Copy link
Copy Markdown
Member

Overview

Formatted all files in ./server with ruff, and added a CI action and pre-commit hook, with instructions.

ruff check is implemented in #1360

Related

Changes

  • ran poetry run ruff format . on the server dir
  • added a ruff pre-commit-hook (first time run takes a minute, thereafter is instantaneous)
  • added a ruff github action check
  • formatted the readme with prettier

Testing

No functional changes.

UI

Notes

To run ruff locally:

  1. cd server
  2. poetry install --only dev to update dev dependencies locally
  3. poetry run ruff format . and poetry run ruff check --fix

To enable auto formatting in vscode:

  1. Install and enable the ruff extension
  2. Add this to your settings.json
{
  "[python]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.fixAll": "explicit",
    },
    "editor.defaultFormatter": "charliermarsh.ruff"
  },
}

Set up pre-commit hooks:

Install pre-commit on macOS via Homebrew (bash) or script:

brew install pre-commit
# or
curl https://pre-commit.com/install-local.py | python3 -

Or install via pip or pipx:

pip install pre-commit
# or
pipx install pre-commit

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 681 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.53%. Comparing base (723bbb7) to head (f094322).

Files with missing lines Patch % Lines
...ts/workspace_operations/project_meta_operations.py 4.91% 58 Missing ⚠️
server/portal/apps/workspace/api/views.py 44.68% 47 Missing and 5 partials ⚠️
server/portal/apps/publications/views.py 2.43% 40 Missing ⚠️
...workspace_operations/project_publish_operations.py 23.40% 36 Missing ⚠️
server/portal/apps/projects/managers/base.py 5.40% 35 Missing ⚠️
server/portal/apps/projects/tasks.py 5.71% 33 Missing ⚠️
server/portal/apps/projects/views.py 57.89% 30 Missing and 2 partials ⚠️
server/portal/apps/projects/models/base.py 6.45% 29 Missing ⚠️
server/portal/apps/users/utils.py 27.77% 25 Missing and 1 partial ⚠️
...erver/portal/apps/googledrive_integration/views.py 43.90% 20 Missing and 3 partials ⚠️
... and 66 more
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1359   +/-   ##
=======================================
  Coverage   56.53%   56.53%           
=======================================
  Files         534      534           
  Lines       17153    17153           
  Branches     3490     3496    +6     
=======================================
  Hits         9697     9697           
  Misses       6906     6906           
  Partials      550      550           
Flag Coverage Δ
javascript 58.59% <ø> (ø)
unittests 54.41% <50.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
server/portal/__init__.py 100.00% <100.00%> (ø)
server/portal/apps/accounts/api/urls.py 100.00% <100.00%> (ø)
server/portal/apps/accounts/apps.py 100.00% <100.00%> (ø)
server/portal/apps/accounts/managers/abstract.py 85.71% <100.00%> (ø)
...er/portal/apps/accounts/migrations/0001_initial.py 100.00% <ø> (ø)
.../accounts/migrations/0002_hostkeys_keys_sshkeys.py 100.00% <ø> (ø)
...pps/accounts/migrations/0003_auto_20200131_0207.py 100.00% <ø> (ø)
...pps/accounts/migrations/0004_auto_20200318_2055.py 100.00% <ø> (ø)
...pps/accounts/migrations/0005_auto_20210316_1950.py 100.00% <ø> (ø)
...pps/accounts/migrations/0006_auto_20231018_1927.py 100.00% <ø> (ø)
... and 221 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sophia-massie sophia-massie 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.

Tested ruff checks here. LGTM

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