Skip to content

Commit 7986320

Browse files
feat: add development linting notebook and documentation for ruff checks
1 parent a9e65cd commit 7986320

3 files changed

Lines changed: 71 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,17 @@ python start.py
180180

181181
---
182182

183+
## 🛠️ Development
184+
185+
### Lint (Colab)
186+
187+
```python
188+
!git clone https://github.com/arinadi/HeadlineBot.git
189+
%cd HeadlineBot
190+
!pip install ruff -q
191+
!ruff check . --output-format=concise
192+
```
193+
194+
---
195+
183196
**HeadlineBot***Your story is breaking. Your AI is ready.* 📰⚡

dev_lint.ipynb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 🛠️ HeadlineBot — Lint\n",
8+
"Clone repo, install ruff, run lint."
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": null,
14+
"metadata": {},
15+
"outputs": [],
16+
"source": [
17+
"!git clone https://github.com/arinadi/HeadlineBot.git\n",
18+
"%cd HeadlineBot\n",
19+
"!pip install ruff -q\n",
20+
"!ruff check . --output-format=concise"
21+
]
22+
}
23+
],
24+
"metadata": {
25+
"kernelspec": {
26+
"display_name": "Python 3",
27+
"language": "python",
28+
"name": "python3"
29+
},
30+
"language_info": {
31+
"name": "python",
32+
"version": "3.10.0"
33+
}
34+
},
35+
"nbformat": 4,
36+
"nbformat_minor": 4
37+
}

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.ruff]
2+
line-length = 120
3+
target-version = "py310"
4+
5+
[tool.ruff.lint]
6+
select = [
7+
"E", # pycodestyle errors
8+
"W", # pycodestyle warnings
9+
"F", # pyflakes
10+
"I", # isort
11+
"B", # flake8-bugbear
12+
"UP", # pyupgrade
13+
]
14+
ignore = [
15+
"E501", # line too long (handled by formatter)
16+
"B008", # function call in default argument (FastAPI/Telegram style)
17+
"UP007", # use X | Y for union types
18+
]
19+
20+
[tool.ruff.lint.isort]
21+
known-first-party = ["config", "model_manager", "utils", "bot_classes"]

0 commit comments

Comments
 (0)