Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ruff Python formatter and linter #2233

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mattrunyon
Copy link
Collaborator

Fixes #1255

(This might not actually be breaking, it's more just notes for implementing in DHE)
BREAKING CHANGE:
The app should call MonacoUtils.init with a getWorker function that uses the JSON worker in addition to the general fallback worker when adding support for configuring ruff.

Fixes #1255 

I need to test this doesn't crash if using groovy. Not sure if the ruff
version is available without initializing ruff first or what happens if
it's unavailable.

- Added global setting for minimap, format on save, formatter, and
formatting settings
- Added format on save option and format button to notebook overflow
menu
- Format on save triggers on both shortcut and pressing the save button
- Config editor has JSON schema included
- Config editor cannot be closed by clicking outside the modal, but can
be closed w/ escape key

Something we should add maybe as part of this PR or a final follow-up to
this feature branch is disabling certain/all linting/formatting for the
console. One way we might do this is by registering the console w/ a
specific URI or URI scheme so we can check it when checking if we should
lint. Or include it as a prop to the `MonacoProviders` component. This
would require some changes to the current setup of setting/using the
config on `MonacoProviders` static members/methods

(This might not actually be breaking, it's more just notes for
implementing in DHE)
BREAKING CHANGE:
The app should call `MonacoUtils.init` with a `getWorker` function that
uses the JSON worker in addition to the general fallback worker when
adding support for configuring ruff.
@mattrunyon mattrunyon self-assigned this Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 9.41176% with 231 lines in your changes missing coverage. Please review.

Project coverage is 46.39%. Comparing base (ec9b41e) to head (25ba240).

Files with missing lines Patch % Lines
packages/console/src/monaco/MonacoProviders.tsx 4.08% 94 Missing ⚠️
packages/console/src/monaco/RuffSettingsModal.tsx 4.16% 46 Missing ⚠️
...ashboard-core-plugins/src/panels/NotebookPanel.tsx 0.00% 39 Missing ⚠️
.../code-studio/src/settings/EditorSectionContent.tsx 0.00% 33 Missing ⚠️
...ges/app-utils/src/storage/LocalWorkspaceStorage.ts 0.00% 9 Missing ⚠️
packages/code-studio/src/AppRoot.tsx 0.00% 5 Missing ⚠️
packages/console/src/monaco/MonacoUtils.ts 37.50% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2233      +/-   ##
==========================================
- Coverage   46.61%   46.39%   -0.22%     
==========================================
  Files         692      696       +4     
  Lines       38508    38737     +229     
  Branches     9826     9673     -153     
==========================================
+ Hits        17949    17972      +23     
- Misses      20506    20754     +248     
+ Partials       53       11      -42     
Flag Coverage Δ
unit 46.39% <9.41%> (-0.22%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Automatic code formatting for notebooks
1 participant