File tree Expand file tree Collapse file tree 9 files changed +26
-21
lines changed
Expand file tree Collapse file tree 9 files changed +26
-21
lines changed Original file line number Diff line number Diff line change 2626 https://raw.githubusercontent.com/biocommons/.github/main/etc/labels.yml
2727 .github/labels.yml
2828
29- delete-other-labels : false
29+ delete-other-labels : false
Original file line number Diff line number Diff line change @@ -23,10 +23,9 @@ dev = [
2323 " build ~= 0.8" ,
2424 " ipython ~= 8.4" ,
2525 " mypy-extensions ~= 1.0" ,
26- " pre-commit ~= 3.4 " ,
26+ " pre-commit >= 4.2.0 " ,
2727 " pyright~=1.1" ,
2828 " ruff == 0.12.8" ,
29- " pre-commit>=4.2.0" ,
3029]
3130tests = [
3231 " pytest-cov ~= 4.1" ,
@@ -199,15 +198,17 @@ ignore = [
199198 " E501" ,
200199 " W191" ,
201200 " S321" ,
201+ " COM812" ,
202202 # other
203203 " ANN002" ,
204204 " ANN003" ,
205205 " PLR0913" ,
206206 " PLC0206" ,
207207 " EM101" ,
208208 " D213" ,
209+ " D203" ,
209210 " D400" ,
210- " d415 " ,
211+ " D415 " ,
211212]
212213
213214[tool .ruff .lint .per-file-ignores ]
Original file line number Diff line number Diff line change 88_logger = logging .getLogger (__name__ )
99
1010
11- def main (): # pragma: no cover
11+ def main () -> None : # pragma: no cover
1212 """marvin.example main"""
13- import coloredlogs
13+ import coloredlogs # noqa: PLC0415
1414
1515 logging .Formatter .converter = time .gmtime
1616 coloredlogs .install (
@@ -22,8 +22,8 @@ def main(): # pragma: no cover
2222 quote = marvin .get_quote ()
2323 _logger .warning ("Got quote from Marvin (len=%s)" , len (quote ))
2424
25- print ("Marvin says:" )
26- print (quote )
25+ print ("Marvin says:" ) # noqa: T201
26+ print (quote ) # noqa: T201
2727
2828
2929if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1818
1919
2020def is_alive () -> bool :
21- """tests whether Marvin is alive
21+ """Test whether Marvin is alive
2222
2323 >>> is_alive() is True
2424 True
@@ -28,7 +28,7 @@ def is_alive() -> bool:
2828
2929
3030def get_quote () -> str :
31- """return random Marvin quote
31+ """Return random Marvin quote
3232
3333 eg> get_quote()
3434 "There's only one life-form as intelligent..."
Original file line number Diff line number Diff line change 11"""biocommons.example test, adjacent to code"""
22
3- from .marvin import get_quote
3+ from biocommons . example .marvin import get_quote
44
55
6- def test_get_quote ():
7- """test get_quote"""
6+ def test_get_quote () -> None :
7+ """Test get_quote"""
88 assert get_quote () is not None # noqa: S101
Original file line number Diff line number Diff line change @@ -12,15 +12,15 @@ quotes:
1212 fifty thousand times more intelligent than you and even I don't
1313 know the answer. It gives me a headache just trying to think down
1414 to your level.
15-
15+
1616 - >-
1717 There's only one life-form as intelligent as me within thirty
1818 parsecs of here and that's me.
19-
19+
2020 - >-
2121 I wish you'd just tell me rather trying to engage my enthusiasm
2222 because I haven't got one.
23-
23+
2424 - >-
2525 And then, of course, I've got this terrible pain in all the diodes
2626 down my left side.
Original file line number Diff line number Diff line change 1+ """Declare tests internal to src directory"""
Original file line number Diff line number Diff line change 1+ """Provide fixtures to tests."""
2+
13import importlib .resources
24
35import pytest
46import yaml
57
68
7- @pytest .fixture ()
8- def all_quotes ():
9+ @pytest .fixture
10+ def all_quotes () -> None :
11+ """Provide quotes fixture"""
912 quotes_stream = importlib .resources .files ("example" ).joinpath ("quotes.yaml" ).read_text ()
1013 return yaml .load (quotes_stream , Loader = yaml .SafeLoader )["quotes" ]
Original file line number Diff line number Diff line change 11"""biocommons.example test, within tests directory adjacent to source"""
22
3- from . .marvin import get_quote
3+ from biocommons . example .marvin import get_quote
44
55
6- def test_get_quote (all_quotes ) :
7- """test get_quote"""
6+ def test_get_quote (all_quotes : list [ str ]) -> None :
7+ """Test get_quote"""
88 # NB: all_quotes argument is a test fixture; see ./conftest.py
99 assert get_quote () in all_quotes # noqa: S101
You can’t perform that action at this time.
0 commit comments