Skip to content

Commit

Permalink
New option: Let linter ignore the external links (#3046)
Browse files Browse the repository at this point in the history
* let linter ignore the external links

* fixed: typo
  • Loading branch information
Vincent authored and istio-testing committed Jan 7, 2019
1 parent ca2821c commit 4fd40a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Makefile
@@ -1,6 +1,9 @@

img := gcr.io/istio-testing/website-builder:2018-11-26
docker := docker run -e INTERNAL_ONLY=true -t -i --sig-proxy=true --rm -v $(shell pwd):/site -w /site $(img)

ifeq ($(INTERNAL_ONLY),)
docker := docker run -t -i --sig-proxy=true --rm -v $(shell pwd):/site -w /site $(img)
endif

ifeq ($(CONTEXT),production)
baseurl := "$(URL)"
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -58,6 +58,12 @@ If you get spelling errors, you have three choices to address each:

* It's really valid, so go add the word to the `.spelling` file at the root of the repo.

And you can set any value to an environment variable named "INTERNAL_ONLY", then the linter will not check external links. It looks like that:

```bash
$ make INTERNAL_ONLY=True lint
```

## Site infrastructure

Here's how things work:
Expand Down
5 changes: 3 additions & 2 deletions scripts/lint_site.sh
Expand Up @@ -7,6 +7,8 @@ mdspell --version
echo -ne "mdl "
mdl --version
htmlproofer --version
DISABLE_EXTERNAL=${INTERNAL_ONLY:-false}


# This performs spell checking and style checking over markdown files in a content
# directory. It transforms the shortcode sequences we use to annotate code blocks
Expand Down Expand Up @@ -76,8 +78,7 @@ then
echo "Ensure markdown content only uses standard quotation marks and not “"
FAILED=1
fi

htmlproofer ./public --assume-extension --check-html --check-external-hash --check-opengraph --timeframe 2d --storage-dir .htmlproofer --url-ignore "/localhost/,/github.com/istio/istio.io/edit/master/,/github.com/istio/istio/issues/new/choose/,/groups.google.com/forum/,/www.trulia.com/"
htmlproofer ./public --assume-extension --check-html --disable_external ${DISABLE_EXTERNAL} --check-external-hash --check-opengraph --timeframe 2d --storage-dir .htmlproofer --url-ignore "/localhost/,/github.com/istio/istio.io/edit/master/,/github.com/istio/istio/issues/new/choose/,/groups.google.com/forum/,/www.trulia.com/"
if [ "$?" != "0" ]
then
FAILED=1
Expand Down

0 comments on commit 4fd40a2

Please sign in to comment.