diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8415159 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.PHONY: style + +export check_dirs := src examples tests + +style: + black ${check_dirs} + isort ${check_dirs} + ruff check ${check_dirs} --fix \ No newline at end of file diff --git a/examples/basic.py b/examples/basic.py index b7c423d..b814bc7 100644 --- a/examples/basic.py +++ b/examples/basic.py @@ -20,11 +20,11 @@ activation.gelu_fast(y, x) print("Kernel successfully executed") # Check results -expected = torch.tensor([ - [0.8408, 1.9551, 2.9961], - [4.0000, 5.0000, 6.0000], - [7.0000, 8.0000, 9.0000] -], device='cuda:0', dtype=torch.float16) +expected = torch.tensor( + [[0.8408, 1.9551, 2.9961], [4.0000, 5.0000, 6.0000], [7.0000, 8.0000, 9.0000]], + device="cuda:0", + dtype=torch.float16, +) assert torch.allclose(y, expected) print("Calculated values are exact") diff --git a/pyproject.toml b/pyproject.toml index 6b53fd9..f1c4651 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,9 @@ kernels = "kernels.cli:main" [project.entry-points."egg_info.writers"] "kernels.lock" = "kernels.lockfile:write_egg_lockfile" +[tool.isort] +profile = "black" +line_length = 119 [tool.ruff] exclude = [ @@ -71,4 +74,4 @@ line-length = 119 # Ignored rules: # "E501" -> line length violation lint.ignore = ["E501"] -lint.select = ["E", "F", "I", "W"] +lint.select = ["E", "F", "W"]