Skip to content

Commit

Permalink
build(lint): use ruff from snap (#4602)
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Feb 22, 2024
1 parent 7cfb609 commit 8a9a5c2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "::group::Begin snap install"
echo "Installing snaps in the background while running apt and pip..."
sudo snap install --no-wait --classic pyright --revision 735 # version 1.1.344
sudo snap install --no-wait shellcheck
sudo snap install --no-wait shellcheck ruff
echo "::endgroup::"
echo "::group::apt-get update"
sudo apt-get update
Expand Down
1 change: 0 additions & 1 deletion requirements-devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ raven==6.10.0
requests==2.31.0
requests-toolbelt==1.0.0
requests-unixsocket==0.3.0
ruff==0.1.11
SecretStorage==3.3.3
simplejson==3.19.2
six==1.16.0
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def recursive_data_files(directory, install_directory):
"pytest-cov",
"pytest-mock",
"pytest-subprocess",
"ruff",
"tox>=4.5",
"types-PyYAML",
"types-requests",
Expand Down
3 changes: 3 additions & 0 deletions tools/environment-setup-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ sudo snap install shellcheck
# Install pyright for static tests.
sudo snap install pyright --classic

# Install ruff for linting
sudo snap install ruff

echo "Virtual environment may be activated by running:"
echo "source ${SNAPCRAFT_VIRTUAL_ENV_DIR}/bin/activate"
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ base = testenv, lint
labels = lint
allowlist_externals =
shellcheck: bash, xargs
ruff: ruff
commands_pre =
shellcheck: bash -c '{[shellcheck]find} | {[shellcheck]filter} > {env_tmp_dir}/shellcheck_files'
shellcheck: bash -c '{[shellcheck]find} | {[shellcheck]spread_filter} > {env_tmp_dir}/spread_shellcheck_files'
Expand Down Expand Up @@ -143,6 +144,8 @@ commands =
description = Automatically format source code
base = testenv, lint
labels = format
allowlist_externals:
ruff: ruff
commands =
black: black {tty:--color} {posargs} .
ruff: ruff --fix --respect-gitignore setup.py snapcraft tests tools
Expand Down

0 comments on commit 8a9a5c2

Please sign in to comment.