diff --git a/pyproject.toml b/pyproject.toml index 77000dc..667e765 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,11 +72,6 @@ select = [ "F", # Pyflakes "W", # pycodestyle ] -ignore = [ - "B007", - "B028", - "B904", -] target-version = "py38" [tool.ruff.per-file-ignores] diff --git a/wn/__main__.py b/wn/__main__.py index 4bd3c23..c9b1441 100644 --- a/wn/__main__.py +++ b/wn/__main__.py @@ -61,7 +61,7 @@ def _validate(args): with open(args.output_file, 'w') as outfile: json.dump(report, outfile, indent=2) else: - for code, check in report.items(): + for _code, check in report.items(): if not check['items']: continue print(f' {check["message"]}') diff --git a/wn/_core.py b/wn/_core.py index 2fa911d..fd24dd7 100644 --- a/wn/_core.py +++ b/wn/_core.py @@ -1133,7 +1133,8 @@ def __init__( if missing: warnings.warn( f'lexicon dependencies not available: {missing}', - wn.WnWarning + wn.WnWarning, + stacklevel=2, ) expand = ' '.join( f'{id}:{ver}' for id, ver, _id in deps if _id is not None @@ -1160,7 +1161,7 @@ def word(self, id: str) -> Word: try: return Word(*next(iterable), self) except StopIteration: - raise wn.Error(f'no such lexical entry: {id}') + raise wn.Error(f'no such lexical entry: {id}') from None def words( self, @@ -1183,7 +1184,7 @@ def synset(self, id: str) -> Synset: try: return Synset(*next(iterable), self) except StopIteration: - raise wn.Error(f'no such synset: {id}') + raise wn.Error(f'no such synset: {id}') from None def synsets( self, @@ -1210,7 +1211,7 @@ def sense(self, id: str) -> Sense: try: return Sense(*next(iterable), self) except StopIteration: - raise wn.Error(f'no such sense: {id}') + raise wn.Error(f'no such sense: {id}') from None def senses( self, @@ -1233,7 +1234,7 @@ def ili(self, id: str) -> ILI: try: return ILI(*next(iterable)) except StopIteration: - raise wn.Error(f'no such ILI: {id}') + raise wn.Error(f'no such ILI: {id}') from None def ilis(self, status: Optional[str] = None) -> List[ILI]: """Return the list of ILIs in this wordnet.