Skip to content

Commit ac64505

Browse files
Merge pull request microsoft#121 from microsoft/three-files-branch
Add linting configuration files
2 parents 8d2a208 + c754df9 commit ac64505

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 120
3+
exclude = .venv, _pycache_, migrations
4+
ignore = E501,F401,F811,F841,E203,E231,W503

.github/workflows/pylint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Code Quality Workflow
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.11"]
11+
12+
steps:
13+
# Step 1: Checkout code
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
# Step 2: Set up Python environment
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
# Step 3: Run all code quality checks
24+
- name: Run Code Quality Checks
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
echo "Fixing imports with Isort..."
29+
python -m isort --verbose .
30+
echo "Formatting code with Black..."
31+
python -m black --verbose .
32+
echo "Running Flake8..."
33+
python -m flake8 --config=.flake8 --verbose .
34+
echo "Running Pylint..."
35+
python -m pylint --rcfile=.pylintrc --verbose .

.pylintrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[MASTER]
2+
ignore=__pycache__, migrations, .venv
3+
4+
[MESSAGES CONTROL]
5+
6+
disable=parse-error,missing-docstring,too-many-arguments,line-too-long
7+
8+
[FORMAT]
9+
10+
max-line-length=120
11+
12+
[DESIGN]
13+
14+
max-args=10
15+
max-locals=25
16+
max-branches=15
17+
max-statements=75
18+
19+
[REPORTS]
20+
output-format=colorized
21+
reports=no
22+
23+
[EXCEPTIONS]
24+
overgeneral-exceptions=builtins.Exception,builtins.BaseException

requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ uvicorn==0.24.0
1010
aiohttp==3.10.5
1111
gunicorn==20.1.0
1212
pydantic-settings==2.2.1
13+
# Development Tools
14+
pylint==2.17.5
15+
autopep8==2.0.2
16+
black==23.9.1
17+
isort==5.12.0
18+
flake8==6.0.0
19+
pyment==0.3.3
20+
charset-normalizer==3.3.0
21+
pycodestyle==2.10.0

0 commit comments

Comments
 (0)