-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from pixelsoccupied/md-test
markdown linter
- Loading branch information
Showing
5 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,6 @@ Dockerfile.cross | |
*.swp | ||
*.swo | ||
*~ | ||
|
||
#macOS | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash -xe | ||
# Following example of: https://github.com/openshift/enhancements/blob/master/hack/install-markdownlint.sh | ||
|
||
cat /etc/redhat-release || echo "No /etc/redhat-release" | ||
|
||
if grep -q 'Red Hat Enterprise Linux' /etc/redhat-release; then | ||
# install the config file for the RPM repository with node 14 | ||
# steps taken from https://rpm.nodesource.com/setup_14.x | ||
yum module disable -y nodejs | ||
curl -sL -o '/tmp/nodesource.rpm' 'https://rpm.nodesource.com/pub_14.x/el/8/x86_64/nodesource-release-el8-1.noarch.rpm' | ||
rpm -i --nosignature --force /tmp/nodesource.rpm | ||
yum -y install nodejs | ||
else | ||
# Fedora has a module we can use | ||
dnf -y module enable nodejs:16 | ||
dnf -y install nodejs | ||
fi | ||
|
||
npm install -g [email protected] [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Following example of: https://github.com/openshift/enhancements/blob/master/hack/Dockerfile.markdownlint | ||
FROM registry.access.redhat.com/ubi9/ubi:latest | ||
WORKDIR /workdir | ||
RUN dnf install -y git golang | ||
COPY markdownlint-install.sh /tmp | ||
RUN /tmp/markdownlint-install.sh | ||
ENTRYPOINT /workdir/hack/markdownlint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -ex | ||
# Following example of: https://github.com/openshift/enhancements/blob/master/hack/markdownlint.sh | ||
|
||
# trap errors, including the exit code from the command failed | ||
trap 'handle_exit $?' EXIT | ||
|
||
function handle_exit { | ||
# If the exit code we were given indicates an error, suggest that | ||
# the author run the linter locally. | ||
if [ "$1" != "0" ]; then | ||
cat - <<EOF | ||
To run the linter on a Linux system with podman, run "make markdownlint" | ||
after committing your changes locally. | ||
EOF | ||
fi | ||
} | ||
|
||
markdownlint-cli2 '**/*.md' !'vendor/**/*.md' |