Skip to content

Commit

Permalink
Merge pull request #1854 from dandi/fix-lint-errors
Browse files Browse the repository at this point in the history
Fix lint errors
  • Loading branch information
waxlamp authored Feb 7, 2024
2 parents e333fc3 + c1758fc commit 54a67fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
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]
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

0 comments on commit 54a67fe

Please sign in to comment.