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

Add Ruff to CI #21739

Merged
merged 26 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3740925
run ruff instead of pyright
anthonykim1 Aug 2, 2023
2005d16
Fix github action name by capitalizing
anthonykim1 Aug 2, 2023
4b8b9c2
format with prettier
anthonykim1 Aug 2, 2023
b424581
add Ruff to lint workflow
anthonykim1 Aug 2, 2023
3bb9461
line-length 120 for Ruff toml
anthonykim1 Aug 2, 2023
0591728
exempt testing files as such from Pyright
anthonykim1 Aug 2, 2023
54d3c42
Ignore testing_tools files same as Pyright way
anthonykim1 Aug 2, 2023
d3ba893
Change line length to 140
anthonykim1 Aug 3, 2023
7b2efc8
ignore import top level warning
anthonykim1 Aug 3, 2023
35c28c5
exclude old testing files
anthonykim1 Aug 3, 2023
6406c6d
fix empty try except
anthonykim1 Aug 3, 2023
48f0164
fix more bare exceptions
anthonykim1 Aug 3, 2023
cf15203
remove unused imports
anthonykim1 Aug 3, 2023
2f92f7e
fix true conditional to ruff compliant
anthonykim1 Aug 3, 2023
c3579e2
bring back import used in testing
anthonykim1 Aug 3, 2023
a9c4863
bring back import something_else
anthonykim1 Aug 3, 2023
db6dda4
bring back import something_else
anthonykim1 Aug 3, 2023
ab4d1fe
skip old test file and incorrect file name
anthonykim1 Aug 4, 2023
5bac895
fix typo on .toml file
anthonykim1 Aug 4, 2023
5c129d7
format comment and respect ruff confused imports
anthonykim1 Aug 4, 2023
b51a2ec
Merge branch 'main' into add-ruff-to-CI
anthonykim1 Aug 4, 2023
8cd26e0
remove unused imports expected_execution_test_out
anthonykim1 Aug 4, 2023
cf0d542
fix warning execution.py
anthonykim1 Aug 4, 2023
85ea52f
fix warning logParser.py
anthonykim1 Aug 4, 2023
46a2911
switch from github action to pip install
anthonykim1 Aug 4, 2023
a7c6d51
follow ruff doc to run
anthonykim1 Aug 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ runs:
python -m black . --check
working-directory: pythonFiles
shell: bash

- name: Run Ruff
uses: chartboost/ruff-action@v1
with:
src: './pythonFiles'
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need to use this GH action. We can run it directly like we do black in the previous one.

Copy link
Author

Choose a reason for hiding this comment

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

So do you mean get rid of it and do "python -m pip install -U ruff" and "python -m ruff . --check" ? Whats the difference between two?

Copy link
Author

Choose a reason for hiding this comment

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

Switched like advised and passing all the test!

24 changes: 24 additions & 0 deletions pythonFiles/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ ignore = [
'tests/testing_tools/adapter/pytest/test_cli.py',
'tests/testing_tools/adapter/pytest/test_discovery.py',
]

[tool.ruff]
line-length = 140
eleanorjboyd marked this conversation as resolved.
Show resolved Hide resolved
exclude = [
# Ignore testing_tools files same as Pyright way
'get-pip.py',
'install_debugpy.py',
'tensorboard_launcher.py',
'testlauncher.py',
'visualstudio_py_testlauncher.py',
'testing_tools/unittest_discovery.py',
'testing_tools/adapter/util.py',
'testing_tools/adapter/pytest/_discovery.py',
'testing_tools/adapter/pytest/_pytest_item.py',
'tests/debug_adapter/test_install_debugpy.py',
'tests/testing_tools/adapter/.data',
'tests/testing_tools/adapter/test___main__.py',
'tests/testing_tools/adapter/test_discovery.py',
'tests/testing_tools/adapter/test_functional.py',
'tests/testing_tools/adapter/test_report.py',
'tests/testing_tools/adapter/test_util.py',
'tests/testing_tools/adapter/pytest/test_cli.py',
'tests/testing_tools/adapter/pytest/test_discovery.py',
]