Create a new command databricks labs ucx lint-local-code
A new command is created within the ucx cli that allows linting of local python files and local notebooks.
databricks labs ucx lint-local-code
Will prompt to ask if all files in the current directory and child directories should be linted. Upon confirmation, the local python files and notebooks will be discovered and advisories will be raised for any issues identified.
Changes
Linked issues
Resolves #1541
Functionality
- [ ] added relevant user documentation
- [x] added new CLI command
- [ ] modified existing command:
databricks labs ucx ... - [ ] added a new workflow
- [ ] modified existing workflow:
... - [ ] added a new table
- [ ] modified existing table:
...
Tests
- [x] manually tested
- [ ] added unit tests
- [ ] added integration tests
- [ ] verified on staging environment (screenshot attached)
Codecov Report
Attention: Patch coverage is 43.75000% with 27 lines in your changes are missing coverage. Please review.
Project coverage is 89.38%. Comparing base (
ad1e2d9) to head (5a77bc7).
:exclamation: Current head 5a77bc7 differs from pull request most recent head 386ee97. Consider uploading reports for the commit 386ee97 to get more accurate results
| Files | Patch % | Lines |
|---|---|---|
| src/databricks/labs/ucx/source_code/files.py | 33.33% | 24 Missing and 2 partials :warning: |
| src/databricks/labs/ucx/contexts/cli_command.py | 75.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1594 +/- ##
=========================================
+ Coverage 0 89.38% +89.38%
=========================================
Files 0 79 +79
Lines 0 10296 +10296
Branches 0 1820 +1820
=========================================
+ Hits 0 9203 +9203
- Misses 0 722 +722
- Partials 0 371 +371
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@ericvergnaud do it based on https://github.com/databrickslabs/ucx/blob/1ae345a15ff8eedf475b8fef5571de6163e29bcd/src/databricks/labs/ucx/source_code/notebooks/sources.py#L111-L154
superseded by https://github.com/databrickslabs/ucx/pull/1710 because the source branch is jim's and needs massive rebase
closing as per last comment