Skip to content

Commit

Permalink
Run make noqa again
Browse files Browse the repository at this point in the history
  • Loading branch information
seanh committed Feb 6, 2025
1 parent cb94b99 commit e07a0af
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion h/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def fetch_git_ref():
return subprocess.check_output( # noqa: S603
["git", "rev-parse", "--short", "HEAD"],
["git", "rev-parse", "--short", "HEAD"], # noqa: S607
stderr=DEVNULL,
).strip()

Expand Down
2 changes: 1 addition & 1 deletion h/cli/commands/devdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def devdata(ctx):
)

with open( # noqa: PTH123
os.path.join(git_dir, "h", "devdata.json"),
os.path.join(git_dir, "h", "devdata.json"), # noqa: PTH118
encoding="utf8",
) as handle:
DevDataFactory(
Expand Down
2 changes: 1 addition & 1 deletion h/models/document/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __repr__(self):
def create_or_update_document_meta( # noqa: PLR0913
session,
claimant,
type,
type, # noqa: A002
value,
document,
created,
Expand Down
2 changes: 1 addition & 1 deletion h/models/document/_uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create_or_update_document_uri( # noqa: PLR0913
session,
claimant,
uri,
type,
type, # noqa: A002
content_type,
document,
created,
Expand Down
2 changes: 1 addition & 1 deletion h/services/annotation_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_annotations_by_id(

@staticmethod
def _annotation_search_query(
ids: list[str] = None,
ids: list[str] = None, # noqa: RUF013
eager_load: list | None = None,
) -> Query:
"""Create a query for searching for annotations."""
Expand Down
2 changes: 1 addition & 1 deletion h/services/job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def add_by_ids(
name,
annotation_ids: list[str],
tag,
force=False,
force=False, # noqa: FBT002
schedule_in=None,
):
"""
Expand Down
16 changes: 8 additions & 8 deletions h/services/oauth/_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ def client_authentication_required(self, request, *args, **kwargs): # noqa: ARG

def confirm_redirect_uri(
self,
client_id,
code,
client_id, # noqa: ARG002
code, # noqa: ARG002
redirect_uri,
client,
*args,
*args, # noqa: ARG002
**kwargs, # noqa: ARG002
):
"""
Expand Down Expand Up @@ -278,11 +278,11 @@ def validate_code(self, client_id, code, client, request, *args, **kwargs): # n

def validate_grant_type(
self,
client_id,
client_id, # noqa: ARG002
grant_type,
client,
request,
*args,
request, # noqa: ARG002
*args, # noqa: ARG002
**kwargs, # noqa: ARG002
):
"""Validate that the given client is allowed to use the give grant type."""
Expand Down Expand Up @@ -336,8 +336,8 @@ def validate_response_type(
self,
client_id,
response_type,
request,
*args,
request, # noqa: ARG002
*args, # noqa: ARG002
**kwargs, # noqa: ARG002
):
"""Validate that the provided ``response_type`` matches the one stored on the client."""
Expand Down
2 changes: 1 addition & 1 deletion h/tasks/job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def add_annotations_by_ids(
name,
annotation_ids: list[str],
tag,
force=False,
force=False, # noqa: FBT002
schedule_in=None,
):
celery.request.find_service(name="queue_service").add_by_ids(
Expand Down
2 changes: 1 addition & 1 deletion h/tweens.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def conditional_http_tween_factory(
handler, registry
handler, registry # noqa: ARG001
): # pragma: no cover
"""Set up conditional response handling for some requests."""

Expand Down
2 changes: 1 addition & 1 deletion h/viewderivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def csp_protected_view(view, info):

policy = info.registry.settings.get("csp", {})
clauses = [
" ".join([directive] + values)
" ".join([directive] + values) # noqa: RUF005
for directive, values in sorted(policy.items())
]
header_value = "; ".join(clauses)
Expand Down
4 changes: 2 additions & 2 deletions h/views/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ def debug_token(request):
bearer_token = svc.get_bearer_token(request)
if not bearer_token:
raise OAuthTokenError( # noqa: TRY003
"Bearer token is missing in Authorization HTTP header",
"Bearer token is missing in Authorization HTTP header", # noqa: EM101
"missing_token",
)

if not svc.validate(bearer_token):
raise OAuthTokenError( # noqa: TRY003
"Bearer token does not exist or is expired",
"Bearer token does not exist or is expired", # noqa: EM101
"missing_token",
)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/h/activity/query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def test_it_buckets_the_annotations(

def test_it_fetches_the_groups_from_the_database(
self,
_fetch_groups,
_fetch_groups, # noqa: PT019
group_pubids,
pyramid_request,
):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/h/feeds/atom_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_entry_title(factories):

def test_entry_dates(factories):
annotation = factories.Annotation(
created=datetime.utcnow(),
created=datetime.utcnow(), # noqa: DTZ003
updated=datetime.utcnow() + timedelta(hours=1), # noqa: DTZ003
)

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/h/models/document/_uri_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_it_updates_the_existing_DocumentURI_if_there_is_one(
original_attrs = doc_uri_attrs
updated_attrs = dict(
original_attrs,
created=datetime.now(),
created=datetime.now(), # noqa: DTZ005
updated=datetime.now(), # noqa: DTZ005
)
document_uri = DocumentURI(**original_attrs)
Expand All @@ -108,7 +108,7 @@ def test_it_creates_a_new_DocumentURI_if_there_is_no_existing_one(
original_attrs = doc_uri_attrs
updated_attrs = dict(
original_attrs,
created=datetime.now(),
created=datetime.now(), # noqa: DTZ005
updated=datetime.now(), # noqa: DTZ005
)
# Add one non-matching DocumentURI to the database.
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/h/security/policy/_cookie_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def remember(cookie, *_args, **_kwargs):
sentinel.api_authcookie_header_2,
]

assert False, (
assert False, ( # noqa: B011, PT015
"Should never reach here"
) # pragma: no cover

Expand Down Expand Up @@ -167,7 +167,7 @@ def forget(cookie, *_args, **_kwargs):
sentinel.api_authcookie_header_2,
]

assert False, (
assert False, ( # noqa: B011, PT015
"Should never reach here"
) # pragma: no cover

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/h/services/links_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def registry(pyramid_config):
add_annotation_link_generator(
pyramid_config,
"kiwi",
lambda r, a: "http://kiwi.net",
lambda r, a: "http://kiwi.net", # noqa: ARG005
hidden=True,
)
add_annotation_link_generator(pyramid_config, "returnsnone", lambda r, a: None) # noqa: ARG005
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/h/streamer/tweens_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def close_db_session_tween(self, handler):
@pytest.fixture
def handler(self):
handler = mock.create_autospec(
lambda request: None
lambda request: None # noqa: ARG005
) # pragma: nocover
return handler

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/h/tweens_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_it_calls_db_rollback_on_exception(self, handler, pyramid_request):
@pytest.fixture
def handler(self):
return mock.create_autospec(
lambda request: None
lambda request: None # noqa: ARG005
) # pragma: nocover

@pytest.fixture
Expand Down
Loading

0 comments on commit e07a0af

Please sign in to comment.