Skip to content

Commit

Permalink
Replace pylint by ruff for lint (#3631)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne authored Dec 5, 2024
1 parent 11f539a commit 84fc2a4
Show file tree
Hide file tree
Showing 4 changed files with 362 additions and 38 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"tests",
"--replay"
],
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"ruff.enable": true,
"pylint.ignorePatterns": ["*"]
}
19 changes: 15 additions & 4 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fi

source venv/bin/activate

echo "Checking Python files..."
echo "Running black formatter..."
if [ "$COMMAND" == "fix" ]; then
black --quiet .
else
Expand All @@ -49,9 +49,20 @@ if ! mypy --config pyproject.toml; then
exit 1
fi

echo "Running pylint checks..."
if ! pylint utils; then
echo "Pylint checks failed. Please fix the errors above. πŸ’₯ πŸ’” πŸ’₯"
echo "Running ruff checks..."
if ! which ruff > /dev/null; then
echo "ruff is not installed, installing it (ETA 5s)"
./build.sh -i runner > /dev/null
fi

if [ "$COMMAND" == "fix" ]; then
ruff_args="--fix"
else
ruff_args=""
fi

if ! ruff check $ruff_args; then
echo "ruff checks failed. Please fix the errors above. πŸ’₯ πŸ’” πŸ’₯"
exit 1
fi

Expand Down
Loading

0 comments on commit 84fc2a4

Please sign in to comment.