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

build: update pre-commit hooks #823

Merged
merged 2 commits into from
Nov 19, 2023
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: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-json
Expand All @@ -22,12 +22,12 @@ repos:
exclude: \.dot$
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
rev: v0.1.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.50.0
rev: v8.54.0
hooks:
- id: eslint
args: [--fix, --color]
Expand Down
5 changes: 1 addition & 4 deletions rdmo/projects/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ def save_import_snapshot_values(project, snapshots, checked):

for value in snapshot.snapshot_values:
if value.attribute:
value_key = '{value.attribute.uri}[{snapshot_index}][{value.set_prefix}][{value.set_index}][{value.collection_index}]'.format( # noqa: E501
value=value,
snapshot_index=snapshot.snapshot_index
)
value_key = f"{value.attribute.uri}[{snapshot.snapshot_index}][{value.set_prefix}][{value.set_index}][{value.collection_index}]" # noqa: E501

if value_key in checked:
# assert that this is a new value
Expand Down
8 changes: 4 additions & 4 deletions rdmo/services/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def get(self, request, url):
response = requests.get(url, headers=self.get_authorization_headers(access_token))

if response.status_code == 401:
logger.warn('get forbidden: %s (%s)', response.content, response.status_code)
logger.warning('get forbidden: %s (%s)', response.content, response.status_code)
else:
try:
response.raise_for_status()
return self.get_success(request, response)

except requests.HTTPError:
logger.warn('get error: %s (%s)', response.content, response.status_code)
logger.warning('get error: %s (%s)', response.content, response.status_code)

return render(request, 'core/error.html', {
'title': _('OAuth error'),
Expand All @@ -53,14 +53,14 @@ def post(self, request, url, data):
response = requests.post(url, json=data, headers=self.get_authorization_headers(access_token))

if response.status_code == 401:
logger.warn('post forbidden: %s (%s)', response.content, response.status_code)
logger.warning('post forbidden: %s (%s)', response.content, response.status_code)
else:
try:
response.raise_for_status()
return self.post_success(request, response)

except requests.HTTPError:
logger.warn('post error: %s (%s)', response.content, response.status_code)
logger.warning('post error: %s (%s)', response.content, response.status_code)

return render(request, 'core/error.html', {
'title': _('OAuth error'),
Expand Down