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

Fix lint errors #1854

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions dandiapi/api/models/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ def citation(cls, metadata):
citation = f'{name} ({year}). (Version {version}) [Data set]. DANDI archive. {url}'
if 'contributor' in metadata and isinstance(metadata['contributor'], list):
cl = '; '.join(
[
val['name']
for val in metadata['contributor']
if 'includeInCitation' in val and val['includeInCitation']
]
[val['name'] for val in metadata['contributor'] if val.get('includeInCitation')]
)
if cl:
citation = (
Expand Down
4 changes: 2 additions & 2 deletions dandiapi/api/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ def user_questionnaire_form_view(request: HttpRequest) -> HttpResponse:
user_metadata.save(update_fields=['questionnaire_form'])

# Save first and last name if applicable
if 'First Name' in req_body and req_body['First Name']:
if req_body.get('First Name'):
user.first_name = req_body['First Name']
user.save(update_fields=['first_name'])
if 'Last Name' in req_body and req_body['Last Name']:
if req_body.get('Last Name'):
user.last_name = req_body['Last Name']
user.save(update_fields=['last_name'])

Expand Down
2 changes: 1 addition & 1 deletion dandiapi/zarr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if TYPE_CHECKING:
from pathlib import Path

logger = logging.Logger(name=__name__)
logger = logging.getLogger(name=__name__)


# The status of the zarr ingestion (checksums, size, file count)
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ exclude = [
[tool.ruff]
line-length = 100
target-version = "py311"

[tool.ruff.lint]
mvandenburgh marked this conversation as resolved.
Show resolved Hide resolved
select = ["ALL"]
ignore = [
# Incompatible with formatter
Expand Down Expand Up @@ -55,7 +57,7 @@ ignore = [
"PTH119", # TODO: re-enable this when it's fixed
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"scripts/**" = [
"INP001", # File is part of an implicit namespace package
]
Expand Down