Skip to content

Commit

Permalink
Added shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Dec 8, 2023
1 parent 529a2e1 commit 9f46075
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ruff: ## Run Ruff linter
docs-style: ## Check documentation strings in all Python sources from this repository
pydocstyle .

shellcheck: ## Run shellcheck
./shellcheck.sh

help: ## Show this help screen
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
@echo ''
Expand Down
23 changes: 23 additions & 0 deletions shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright 2020 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if ! command -v shellcheck > /dev/null 2>&1; then
scversion="stable" # or "v0.4.7", or "latest"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
shellcheck-stable/shellcheck --version
shellcheck-stable/shellcheck --exclude=SC2230 -- *.sh
else
shellcheck --exclude=SC2230 -- *.sh
fi

0 comments on commit 9f46075

Please sign in to comment.