Skip to content

Commit 48c8857

Browse files
committed
Ignore more things and fix remaining lints
1 parent db6916f commit 48c8857

File tree

11 files changed

+38
-18
lines changed

11 files changed

+38
-18
lines changed

examples/connect/databricks/dash/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def update_page(_):
3838
"""
3939
session_token = flask.request.headers.get("Posit-Connect-User-Session-Token")
4040
posit_strategy = PositCredentialsStrategy(
41-
local_strategy=databricks_cli, user_session_token=session_token,
41+
local_strategy=databricks_cli,
42+
user_session_token=session_token,
4243
)
4344
cfg = Config(
4445
host=DATABRICKS_HOST_URL,

examples/connect/databricks/flask/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def get_fares():
3131

3232
session_token = request.headers.get("Posit-Connect-User-Session-Token")
3333
posit_strategy = PositCredentialsStrategy(
34-
local_strategy=databricks_cli, user_session_token=session_token,
34+
local_strategy=databricks_cli,
35+
user_session_token=session_token,
3536
)
3637
cfg = Config(
3738
host=DATABRICKS_HOST_URL,

examples/connect/databricks/shiny/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def server(i: Inputs, o: Outputs, session: Session):
2424
"""
2525
session_token = session.http_conn.headers.get("Posit-Connect-User-Session-Token")
2626
posit_strategy = PositCredentialsStrategy(
27-
local_strategy=databricks_cli, user_session_token=session_token,
27+
local_strategy=databricks_cli,
28+
user_session_token=session_token,
2829
)
2930
cfg = Config(
3031
host=DATABRICKS_HOST_URL,

examples/connect/databricks/streamlit/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
session_token = st.context.headers.get("Posit-Connect-User-Session-Token")
1818
posit_strategy = PositCredentialsStrategy(
19-
local_strategy=databricks_cli, user_session_token=session_token,
19+
local_strategy=databricks_cli,
20+
user_session_token=session_token,
2021
)
2122
cfg = Config(
2223
host=DATABRICKS_HOST_URL,

integration/tests/posit/connect/test_users.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ class TestUser:
66
def setup_class(cls):
77
cls.client = client = connect.Client()
88
cls.aron = client.users.create(
9-
username="aron", email="[email protected]", password="s3cur3p@ssword",
9+
username="aron",
10+
11+
password="s3cur3p@ssword",
1012
)
1113
cls.bill = client.users.create(
12-
username="bill", email="[email protected]", password="s3cur3p@ssword",
14+
username="bill",
15+
16+
password="s3cur3p@ssword",
1317
)
1418
cls.cole = client.users.create(
15-
username="cole", email="[email protected]", password="s3cur3p@ssword",
19+
username="cole",
20+
21+
password="s3cur3p@ssword",
1622
)
1723

1824
def test_lock(self):
@@ -71,7 +77,9 @@ def test_find_one(self):
7177

7278
def test_multiple_users(self):
7379
user = self.client.users.create(
74-
username="example", email="[email protected]", password="s3cur3p@ssword",
80+
username="example",
81+
82+
password="s3cur3p@ssword",
7583
)
7684
# assert filtering limits to the provided user.
7785
assert self.me.content.find_one() == self.content

pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ docstring-code-line-length = "dynamic"
4545

4646
[tool.ruff.lint]
4747
extend-ignore = [
48-
"E501", # E501: Line too long
49-
"PT011", # PT011 `pytest.raises(ValueError)` is too broad
50-
"PT022", # PT022 [*] No teardown in fixture
51-
"F841", # F841 Local variable is assigned but never used
48+
"E501", # Line too long
49+
"PT011", # `pytest.raises(ValueError)` is too broad
50+
"PT022", # No teardown in fixture
51+
"F841", # Local variable is assigned but never used
52+
"COM812", # missing-trailing-comma
53+
"ISC001", # single-line-implicit-string-concatenation
54+
"ISC002", # multi-line-implicit-string-concatenation
5255
]
5356
extend-select = [
5457
# "C90", # Many false positives # C90; mccabe: https://docs.astral.sh/ruff/rules/complex-structure/

src/posit/connect/vanities.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ def vanity(self) -> None:
185185
--------
186186
reset_vanity
187187
"""
188-
self.vanity
188+
# Populate value
189+
self.vanity # noqa: B018
190+
189191
if self._vanity:
190192
self._vanity.destroy()
191193
self.reset_vanity()

tests/posit/connect/test_bundles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test(self):
144144
task = bundle.deploy()
145145

146146
# assert
147-
task.id == task_id
147+
assert task.id == task_id
148148
assert mock_content_get.call_count == 1
149149
assert mock_bundle_get.call_count == 1
150150
assert mock_bundle_deploy.call_count == 1

tests/posit/connect/test_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def test_request(self, MockSession):
135135
client = Client(api_key=api_key, url=url)
136136
client.request("GET", "/foo")
137137
MockSession.return_value.request.assert_called_once_with(
138-
"GET", "https://connect.example.com/__api__/foo",
138+
"GET",
139+
"https://connect.example.com/__api__/foo",
139140
)
140141

141142
def test_get(self, MockSession):
@@ -180,5 +181,7 @@ def test_required_version(self):
180181
url = "https://connect.example.com"
181182
client = Client(api_key=api_key, url=url)
182183
client.ctx.version = "2024.07.0"
184+
oauth = None
183185
with pytest.raises(RuntimeError):
184-
client.oauth
186+
oauth = client.oauth
187+
assert oauth is not None

tests/posit/connect/test_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test(self):
8888
task = content.deploy()
8989

9090
# assert
91-
task.id == task_id
91+
assert task.id == task_id
9292
assert mock_content_get.call_count == 1
9393
assert mock_content_deploy.call_count == 1
9494
assert mock_tasks_get.call_count == 1

0 commit comments

Comments
 (0)