[object Object]

← back to Exo

clear instructions on formatting with yapf, remove linting

f82410f8083bff5619aa6a2e8bb1e4877dc73ed2 · 2024-10-29 10:42:37 -0700 · Alex Cheema

Files touched

Diff

commit f82410f8083bff5619aa6a2e8bb1e4877dc73ed2
Author: Alex Cheema <alexcheema123@gmail.com>
Date:   Tue Oct 29 10:42:37 2024 -0700

    clear instructions on formatting with yapf, remove linting
---
 README.md | 14 ++++++++++++++
 format.py |  2 +-
 setup.py  |  5 +----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 81abac24..0b12c7c5 100644
--- a/README.md
+++ b/README.md
@@ -222,6 +222,20 @@ For the **tinygrad** inference engine specifically, there is a separate DEBUG fl
 TINYGRAD_DEBUG=2 exo
 ```
 
+## Formatting
+
+We use [yapf](https://github.com/google/yapf) to format the code. To format the code, first install the formatting requirements:
+
+```sh
+pip3 install -e '.[formatting]'
+```
+
+Then run the formatting script:
+
+```sh
+python3 format.py ./exo
+```
+
 ## Known Issues
 
 - On some versions of MacOS/Python, certificates are not installed properly which can lead to SSL errors (e.g. SSL error with huggingface.co). To fix this, run the Install Certificates command, usually:
diff --git a/format.py b/format.py
index 2afda665..68842493 100644
--- a/format.py
+++ b/format.py
@@ -21,7 +21,7 @@ def run_yapf(target):
 
 def main():
   if len(sys.argv) < 2:
-    print("Usage: python format.py <directory_or_file>")
+    print("Usage: python3 format.py <directory_or_file> e.g. python3 format.py ./exo")
     sys.exit(1)
 
   target = sys.argv[1]
diff --git a/setup.py b/setup.py
index 48e29e4f..2a1ddb07 100644
--- a/setup.py
+++ b/setup.py
@@ -30,10 +30,7 @@ install_requires = [
 ]
 
 extras_require = {
-  "linting": [
-    "pylint==3.2.6",
-    "ruff==0.5.5",
-    "mypy==1.11.0",
+  "formatting": [
     "yapf==0.40.2",
   ],
   "apple_silicon": [

← 478db26b get rid of all the different linters. we just use yapf now  ·  back to Exo  ·  revert main.py ac49b2a2 →