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

Fixed pylint's convention recommendation f-strings #468

Merged
merged 3 commits into from
Mar 7, 2025
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
5 changes: 3 additions & 2 deletions sbol3/identified.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import math
import posixpath
from typing import Callable, Any, Optional
import typing
from typing import Any, Callable, Optional
from urllib.parse import urlparse

import rdflib
Expand Down Expand Up @@ -124,7 +125,7 @@ def __init__(self, identity: str, type_uri: str,
initial_value=[type_uri])

def __str__(self):
return '<%s %s>' % (self.__class__.__name__, self.identity)
return f'<{self.__class__.__name__} {self.identity}>'

@staticmethod
def _is_valid_display_id(display_id: str) -> bool:
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ disable = abstract-class-instantiated,
consider-using-get,
disallowed-name,
import-outside-toplevel,
consider-using-f-string,
cyclic-import,
duplicate-code,
fixme,
Expand Down
4 changes: 2 additions & 2 deletions test/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def test_identified_constructors(self):
try:
item(*arg_list)
except TypeError as e:
self.fail('Unable to construct sbol3.%s: %s' % (name, e))
self.fail(f'Unable to construct sbol3.{name}: {e}')
except sbol3.ValidationError as e:
self.fail('Constructed invalid sbol3.%s: %s' % (name, e))
self.fail(f'Constructed invalid sbol3.{name}: {e}')
if item in abstract_list:
# Skip over abstract classes when checking for the
# accept method
Expand Down