Skip to content

Commit 47843de

Browse files
chore: add a formatter script for maintainers (#1785)
1 parent 902d583 commit 47843de

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

.github/maintainers_guide.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,27 @@ our continuous integration](https://github.com/slackapi/python-slack-sdk/blob/v3
6565

6666
## Tasks
6767

68+
### Formatting
69+
70+
This project uses code formatting tools to maintain consistent style. You can format the codebase by running:
71+
72+
```sh
73+
./scripts/format.sh
74+
```
75+
6876
### Testing
6977

7078
#### Unit Tests
7179

7280
When you make changes to this SDK, please write unit tests verifying if the changes work as you expected. You can easily run all the tests and formatting/linter with the below scripts.
7381

74-
Run all the unit tests, code formatter, and code analyzer:
82+
Run all the unit tests, code linter, and code analyzer:
7583

7684
```sh
7785
./scripts/run_validation.sh
7886
```
7987

80-
Run all the unit tests (no formatter nor code analyzer):
88+
Run all the unit tests (no linter nor code analyzer):
8189

8290
```sh
8391
./scripts/run_unit_tests.sh

requirements/testing.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@ aiohttp<4 # used for a WebSocket server mock
33
pytest>=7.0.1,<9
44
pytest-asyncio<2 # for async
55
pytest-cov>=2,<8
6-
# while flake8 5.x have issues with Python 3.12, flake8 6.x requires Python >= 3.8.1,
7-
# so 5.x should be kept in order to stay compatible with Python 3.7/3.8
8-
flake8>=5.0.4,<8
9-
# Don't change this version without running CI builds;
10-
# The latest version may not be available for older Python runtime
11-
black==23.3.0;
126
click==8.0.4 # black is affected by https://github.com/pallets/click/issues/2225
137
psutil>=6.0.0,<8
148
# used only under slack_sdk/*_store
159
boto3<=2
1610
# For AWS tests
1711
moto>=4.0.13,<6
18-
mypy<=1.18.2
1912
# For AsyncSQLAlchemy tests
2013
greenlet<=4
21-
aiosqlite<=1
14+
aiosqlite<=1
15+
-r tools.txt

requirements/tools.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
mypy<=1.18.2
2+
# while flake8 5.x have issues with Python 3.12, flake8 6.x requires Python >= 3.8.1,
3+
# so 5.x should be kept in order to stay compatible with Python 3.7/3.8
4+
flake8>=5.0.4,<8
5+
# Don't change this version without running CI builds;
6+
# The latest version may not be available for older Python runtime
7+
black==23.3.0;

scripts/format.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# ./scripts/format.sh
3+
4+
script_dir=`dirname $0`
5+
cd ${script_dir}/..
6+
7+
pip install -U pip
8+
pip install -U -r requirements/tools.txt
9+
10+
black slack/ slack_sdk/ tests/ integration_tests/

0 commit comments

Comments
 (0)