Skip to content

Commit 7cb6e63

Browse files
committed
ruff_lint_format
1 parent 3142621 commit 7cb6e63

890 files changed

Lines changed: 2303 additions & 7629 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-app.yml

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,15 @@ jobs:
2323
with:
2424
args: "check --fix"
2525
version: ${{ env.RUFF_VERSION }}
26-
# A proposal to replace black & pylint
27-
# - uses: chartboost/ruff-action@v1
28-
# with:
29-
# args: "format --check"
30-
# version: ${{ env.RUFF_VERSION }}
31-
32-
black:
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v6
36-
- uses: actions/setup-python@v3
37-
with:
38-
python-version: ${{ env.DEFAULT_PYTHON }}
39-
- uses: psf/black@24.4.2
40-
41-
pylint:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v6
45-
- uses: actions/setup-python@v4
46-
with:
47-
python-version: ${{ env.DEFAULT_PYTHON }}
48-
- name: Install uv
49-
uses: astral-sh/setup-uv@v7
26+
- uses: chartboost/ruff-action@v1
5027
with:
51-
version: ${{ env.UV_VERSION }}
52-
- name: Install Requirements
53-
run: uv sync --frozen --all-extras
54-
- name: Run Pylint
55-
run: |
56-
uv run pylint office365
28+
args: "format --check"
29+
version: ${{ env.RUFF_VERSION }}
5730

5831
pytest:
5932
runs-on: ubuntu-latest
6033
needs:
6134
- ruff
62-
- black
63-
- pylint
6435
steps:
6536
- uses: actions/checkout@v6
6637
- name: Set up Python ${{ env.DEFAULT_PYTHON }}

.isort.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,8 @@ repos:
2020
language: system
2121
pass_filenames: false
2222

23-
# A proposal to replace black & pylint
24-
# - id: ruff-format
25-
# name: ruff-format
26-
# entry: uv run ruff format --exit-non-zero-on-fix
27-
# language: system
28-
# pass_filenames: false
29-
30-
- id: black
31-
name: black
32-
entry: uv run black .
23+
- id: ruff-format
24+
name: ruff-format
25+
entry: uv run ruff format --exit-non-zero-on-fix
3326
language: system
3427
pass_filenames: false
35-
36-
- id: pylint
37-
name: pylint
38-
entry: uv run pylint office365
39-
language: system
40-
pass_filenames: false
41-

CONTRIBUTING.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ prek run --all-files
5151

5252
The project uses the following tools (mirroring CI):
5353

54-
- Black (formatting)
55-
- Ruff (linting and import sorting)
56-
- Pylint (static analysis)
54+
- Ruff (linting and formatting)
5755

5856
Line length: 121 characters (configured in `pyproject.toml`).
5957

@@ -127,10 +125,7 @@ CI note: Full E2E tests in CI rely on repository secrets and may not run on fork
127125
### Pull Request Process
128126

129127
1. CI Checks must pass:
130-
- Ruff linting
131-
- Black formatting
132-
- Pylint analysis
133-
- Pytest execution
128+
- Ruff linting and formatting
134129
2. Await maintainer review
135130
3. Update documentation where applicable
136131

examples/auth/gcc_high.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
test_user_principal_name,
1414
)
1515

16-
client = GraphClient(
17-
tenant=test_tenant, environment=AzureEnvironment.USGovernmentHigh
18-
).with_client_secret(test_client_id, test_client_secret)
16+
client = GraphClient(tenant=test_tenant, environment=AzureEnvironment.USGovernmentHigh).with_client_secret(
17+
test_client_id, test_client_secret
18+
)
1919
messages = client.users[test_user_principal_name].messages.get().execute_query()

examples/auth/sharepoint/list_permissions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
test_tenant,
66
)
77

8-
client = GraphClient(tenant=test_tenant).with_client_secret(
9-
test_client_id, test_client_secret
10-
)
8+
client = GraphClient(tenant=test_tenant).with_client_secret(test_client_id, test_client_secret)
119

12-
resource = client.service_principals.get_by_app_id(
13-
"00000003-0000-0ff1-ce00-000000000000"
14-
)
10+
resource = client.service_principals.get_by_app_id("00000003-0000-0ff1-ce00-000000000000")
1511
# principal = client.service_principals.get_by_app_id(test_client_id).get().execute_query()
1612
result = resource.get_application_permissions(test_client_id).execute_query()
1713
for app_role in result.value:

examples/auth/sharepoint/register_apponly.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@
2020
from office365.graph_client import GraphClient
2121
from tests import test_client_id, test_client_secret, test_tenant
2222

23-
client = GraphClient(tenant=test_tenant).with_client_secret(
24-
test_client_id, test_client_secret
25-
)
23+
client = GraphClient(tenant=test_tenant).with_client_secret(test_client_id, test_client_secret)
2624
# client = GraphClient(tenant=test_tenant).with_token_interactive(test_client_id)
27-
resource = client.service_principals.get_by_app_id(
28-
MsAppIds.Office_365_SharePoint_Online
29-
)
25+
resource = client.service_principals.get_by_app_id(MsAppIds.Office_365_SharePoint_Online)
3026
app = client.applications.get_by_app_id(test_client_id)
3127
resource.grant_application_permissions(app, "Sites.FullControl.All").execute_query()

examples/auth/with_client_cert.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ def acquire_token():
2121
authority=authority_url,
2222
client_credential=credentials,
2323
)
24-
result = app.acquire_token_for_client(
25-
scopes=["https://graph.microsoft.com/.default"]
26-
)
24+
result = app.acquire_token_for_client(scopes=["https://graph.microsoft.com/.default"])
2725
return result
2826

2927

examples/auth/with_client_secret.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from office365.graph_client import GraphClient
1212
from tests import test_client_id, test_client_secret, test_tenant
1313

14-
client = GraphClient(tenant=test_tenant).with_client_secret(
15-
test_client_id, test_client_secret
16-
)
14+
client = GraphClient(tenant=test_tenant).with_client_secret(test_client_id, test_client_secret)
1715
root_site = client.sites.root.get().execute_query()
1816
print(root_site.web_url)

examples/auth/with_user_creds.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from office365.graph_client import GraphClient
88
from tests import test_client_id, test_password, test_tenant, test_username
99

10-
client = GraphClient(tenant=test_tenant).with_username_and_password(
11-
test_client_id, test_username, test_password
12-
)
10+
client = GraphClient(tenant=test_tenant).with_username_and_password(test_client_id, test_username, test_password)
1311
me = client.me.get().execute_query()
1412
print(me)

0 commit comments

Comments
 (0)