Skip to content

Commit

Permalink
Merge pull request #60 from solvaholic/issue55
Browse files Browse the repository at this point in the history
Teach linter to run individual commands
  • Loading branch information
solvaholic authored May 9, 2021
2 parents 03eb749 + 4b9ab4c commit 8760f4e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 53 deletions.
30 changes: 0 additions & 30 deletions .github/linters/.markdown-lint.yml

This file was deleted.

20 changes: 8 additions & 12 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ name: Lint Code Base
on:
# Run on pull request open, reopen, and synchronize
pull_request:
branches: [main]
branches: [main]

# Run when manually triggered
workflow_dispatch:


jobs:
build:
# Name the Job
Expand All @@ -26,14 +25,11 @@ jobs:
# Checkout the code base
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

# Run Linter against code base
- name: Lint Code Base
uses: docker://ghcr.io/github/super-linter:v3
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Run yamllint to lint YAML
- name: Lint YAML files
run: yamllint --no-warnings ./

# Run shellcheck to lint shell scripts
- name: Lint shell scripts
run: shellcheck ./scripts/*.sh
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
GITHUB_TOKEN=${{ secrets.PAT }} \
gh api -X POST /repos/:owner/:repo/releases --input -
# When a release is published, update short
# When a release is published, update short
# version tags, for example v2 and v2.2
update-tags:
if: ${{ github.event_name != 'release' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-from-template.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
#
# - Run this workflow to pull changes from the template repository.
#
#
# - Clone this repository. Check out a branch
# - Copy files from the template onto this clone
# - Push the branch to this repository
Expand Down Expand Up @@ -113,4 +113,4 @@ jobs:
--no-edit \
-m "Pull updates from ${REPO_TEMPLATE}" \
-m "Pull updates from ${REPO_TEMPLATE}"
popd
popd
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ srcdir = .

default: lint

lint: lint-super-linter
lint: lint-yaml lint-shell

lint-super-linter:
@echo "Linting all the things..."
lint-yaml:
@echo "Linting all the YAML things..."
@docker run --rm \
-e VALIDATE_ENV=false \
-e RUN_LOCAL=true \
-v "$(realpath .)":"/tmp/lint":ro \
github/super-linter
@echo "All the things linted!"
-v "$(realpath .)":"/tmp/lint":ro \
--entrypoint /usr/local/bin/yamllint \
github/super-linter --no-warnings /tmp/lint
@echo "All the YAML things linted!"

lint-shell:
@echo "Linting all the shell things..."
@docker run --rm --workdir /tmp/lint \
--entrypoint /usr/bin/shellcheck \
-v "$(realpath .)":"/tmp/lint":ro \
github/super-linter ./scripts/*.sh
@echo "All the shell things linted!"

0 comments on commit 8760f4e

Please sign in to comment.