forked from canada-ca/cloud-guardrails
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 canada-ca#4 from nschonni/temaplate-files
chore: Copy linting setup from template repo
- Loading branch information
Showing
9 changed files
with
1,038 additions
and
3 deletions.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto |
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,72 @@ | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
# local bundler files | ||
.bundle | ||
Gemfile.lock | ||
vendor | ||
|
||
# local Jekyll files | ||
_site | ||
.jekyll-metadata |
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,4 @@ | ||
{ | ||
"ignorePatterns": [ | ||
] | ||
} |
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,5 @@ | ||
{ | ||
"default": true, | ||
"MD013": false, | ||
"MD041": false | ||
} |
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,4 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "node" |
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,45 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
var markdownLinkCheck = require('markdown-link-check'); | ||
var fs = require("fs"); | ||
var glob = require("glob"); | ||
var path = require("path"); | ||
var chalk = require("chalk"); | ||
|
||
|
||
var files = glob.sync("**/*.md", {ignore: ["node_modules/**/*.md"]}) | ||
|
||
var config = JSON.parse(fs.readFileSync(".markdown-link-check.json")); | ||
config.timeout = '30s' | ||
|
||
var opts = JSON.parse(fs.readFileSync(".markdown-link-check.json")); | ||
|
||
files.forEach(function(file) { | ||
var markdown = fs.readFileSync(file).toString(); | ||
let opts = Object.assign({}, config); | ||
|
||
opts.baseUrl = path.dirname(path.resolve(file)) + '/'; | ||
|
||
markdownLinkCheck(markdown, opts, function (err, results) { | ||
if (err) { | ||
console.error('Error', err); | ||
return; | ||
} | ||
|
||
console.log(chalk.green("Reading: " + file)); | ||
|
||
results.forEach(function (result) { | ||
if(result.status === "dead") { | ||
if (result.statusCode == 500) { | ||
console.log(chalk.yellow("Server error on target: " + result.link)); | ||
} | ||
else { | ||
process.exitCode = 1 | ||
console.log(chalk.red("Dead: " + result.link)); | ||
} | ||
} | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.