-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# Mac | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class Foo(object): | ||
class Foo: | ||
def hello(self): | ||
return "hello" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import unittest | ||
from hypothesis import given, strategies | ||
|
||
from hypothesis import given, strategies | ||
|
||
from foo import Foo | ||
|
||
|
||
class TestFoo(unittest.TestCase): | ||
|
||
def test_hello(self): | ||
self.assertEqual(Foo().hello(), "hello") | ||
assert Foo().hello() == "hello" | ||
|
||
@given(strategies.integers(), strategies.integers()) | ||
def test_add_commutative(self, a, b): | ||
self.assertEqual(Foo().add(a, b), Foo().add(b, a)) | ||
assert Foo().add(a, b) == Foo().add(b, a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[tool.ruff] | ||
line-length = 120 | ||
select = [ | ||
# A set of chosen linter rules is specified here. | ||
# See https://beta.ruff.rs/docs/rules/ for more info. | ||
# pyflakes (simple obvious errors) | ||
"F", | ||
# pycodestyle (style linter, pep8, black-compatible) | ||
"E", | ||
"W", | ||
# pep8-naming (style linter, pep8 naming conventions) | ||
"N", | ||
# isort (imports sorting) | ||
"I", | ||
# mccabe (cyclomatic complexity analyzer to prevent overcomplicated functions) | ||
"C90", | ||
# pyupgrade (possible syntax upgrades checker) | ||
"UP", | ||
# eradicate (commented-out code finder for it to be removed) | ||
"ERA", | ||
# flake8-2020 (errors related to sys.version or sys.version_info, just in case) | ||
"YTT", | ||
# flake8-annotations (enforces presense of type hints so the codebase is fully typed) | ||
# "ANN", # too burdensome | ||
# flake8-async (async-related mistakes/errors) | ||
"ASYNC", | ||
# flake8-builtins (checks builtin names shadowing, it's better not to) | ||
"A", | ||
# flake8-commas (to enforce trailing commas) | ||
"COM", | ||
# flake8-future-annotations (to ensure enabling modern (3.7+) postponed evaluation of type hints) | ||
"FA", | ||
# flake8-import-conventions (to enforce standartized import aliases like "import pandas as pd") | ||
"ICN", | ||
# flake8-no-pep420 (to enforce presence of __init__.py in packages) | ||
"INP", | ||
# flake8-print (to disallow print statements) | ||
"T20", | ||
# flake8-pytest-style (to improve pytest-related style consistency) | ||
"PT", | ||
# flake8-quotes (to enforce quotes style) | ||
"Q", | ||
# flake8-return (checks mistakes related to return values) | ||
"RET", | ||
# flake8-use-pathlib (to enforce pathlib usage instead of os.path) | ||
"PTH", | ||
# pandas-vet (pandas-related advices) | ||
"PD", | ||
# tryceratops (try/except-related advices) | ||
"TRY", | ||
# ruff-specific advices | ||
"RUF", | ||
] | ||
ignore = [ | ||
"COM812", # The following rules may cause conflicts when used with the formatter: `COM812`. | ||
] |