Skip to content

Commit

Permalink
update: log path
Browse files Browse the repository at this point in the history
  • Loading branch information
TOsmanov committed Jan 14, 2025
1 parent 4215e71 commit ccee971
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 113 deletions.
24 changes: 15 additions & 9 deletions linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ function numberFromLog (logFile, regex, counterror = true) {

const printLintResults = function (verbose = false) {
const markdownlintLogPath = path.resolve(cwd, markdownLintLog)
const markdownlintLogRelPath = path.relative(cwd, markdownlintLogPath)
const markdownFiles = /Linting: (\d+) file/g
const files = fs.readdirSync(__dirname).filter(fn => fn.match(markdownLintLog))
const markdownFilesCount = numberFromLog(files[0], markdownFiles, false)
Expand All @@ -197,16 +198,17 @@ const printLintResults = function (verbose = false) {

// Markdown Link Check
const markdownLinkCheckErrors = /ERROR: (\d+) dead links found!/g
const markdownlinkcheckLog = path.resolve(cwd, markdownLinkCheckLog)
const markdownlinkCheckErrorsCount = numberFromLog(markdownlinkcheckLog, markdownLinkCheckErrors)
const markdownlinkcheckLogPath = path.resolve(cwd, markdownLinkCheckLog)
const markdownlinkcheckLogRelPath = path.relative(cwd, markdownlinkcheckLogPath)
const markdownlinkCheckErrorsCount = numberFromLog(markdownlinkcheckLogPath, markdownLinkCheckErrors)

// Log markdownlint
if (markdownLintErrorsCount !== null && markdownLintErrorsCount !== undefined) {
console.log(`Found ${markdownLintErrorsCount} formatting errors`)
if (verbose) {
printErrorsFile(markdownlintLogPath)
}
console.log(`Full markdownlint log see in ${markdownlintLogPath}\n`)
console.log(`Full markdownlint log see in ${markdownlintLogRelPath}\n`)
if (markdownlinkCheckErrorsCount !== null && markdownlinkCheckErrorsCount !== undefined) {
if (verbose) {
console.log(`\n${'='.repeat(80)}\n`)
Expand All @@ -218,9 +220,9 @@ const printLintResults = function (verbose = false) {
if (markdownlinkCheckErrorsCount !== null && markdownlinkCheckErrorsCount !== undefined) {
console.log(`Found ${markdownlinkCheckErrorsCount} broken external links`)
if (verbose) {
printErrorsFile(markdownlinkcheckLog)
printErrorsFile(markdownlinkcheckLogPath)
}
console.log(`Full markdown-link-check log see in ${markdownlinkcheckLog}\n`)
console.log(`Full markdown-link-check log see in ${markdownlinkcheckLogRelPath}\n`)
}
}

Expand Down Expand Up @@ -351,7 +353,9 @@ function generateIncludesMap (foliantConfig, debug) {
console.error('Error generation includes map:', result.error)
} else {
spinnerPrepare.stop(true)
console.log(`Subprocess "Foliant" exited with code ${result.status}`)
if (debug) {
console.log(`Subprocess "Foliant" exited with code ${result.status}`)
}
}
}

Expand Down Expand Up @@ -431,9 +435,11 @@ function execute (command, verbose = false, debug = false, allowFailure = false,
}
}
}
spinnerLint.stop(true)
console.log(l.join('\n'))
spinnerLint.start()
if (l.length > 0) {
spinnerLint.stop(true)
console.log(l.join('\n'))
spinnerLint.start()
}
}

function printMarkdownReport (markdownlintResults, counterError) {
Expand Down
56 changes: 28 additions & 28 deletions test/linter-cjs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('markdown -m slim --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 8 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 21 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m slim', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -31,7 +31,7 @@ test('markdown -m slim -l --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 8 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`,
`Full markdownlint log see in .markdownlint.log\n`,

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 34 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
`removing ${path.join(cwd, '.markdownlint-cli2.cjs ...')}`]
const result = await cli(['markdown', '-m slim', '-l', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(false)
Expand All @@ -45,7 +45,7 @@ test('markdown -m slim -c <custom-config-path> --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 2 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 48 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m slim', `-c ${customConfigPath}`, '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -58,7 +58,7 @@ test('markdown -m slim -l -c <custom-config-path> --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 2 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`,
`Full markdownlint log see in .markdownlint.log\n`,

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 61 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
`removing ${path.join(cwd, '.markdownlint-cli2.cjs ...')}\n`]
const result = await cli(['markdown', '-m slim', '-l', `-c ${customConfigPath}`, '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(false)
Expand All @@ -84,7 +84,7 @@ test('markdown -m slim -v --format cjs', async () => {
'--------------------------------------------------------------------------------\n',
'FILE: src/subproject/article.md\n',
'src/subproject/article.md:8 validate-internal-links Broken link [invalid local anchor] [Context: "#anchor"]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 87 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m slim', '-v', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -104,7 +104,7 @@ test('markdown -m slim -v -s alt-src --format cjs', async () => {
'alt-src/linter-test-B.md:21 fenced-code-in-quote Fenced code shouldn\'t be in quote\n',
'alt-src/linter-test-B.md:25 validate-internal-links Broken link [image does not exist] [Context: "/red-circle.png"]\n',
'alt-src/linter-test-B.md:29 indented-fence Fenced code shouldn\'t be indented by 1 to 3 spaces [Context: " ```bash"]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 107 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m slim', '-v', '-s alt-src', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -117,7 +117,7 @@ test('markdown -m slim -v -s no-errors-src -a --format cjs', async () => {
const expectedStdout = [
'Checked 1 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 120 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m slim', '-v', '-s no-errors-src', '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -130,7 +130,7 @@ test('markdown -m full --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 11 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 133 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m full', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -143,7 +143,7 @@ test('markdown -m full -l', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 11 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`,
`Full markdownlint log see in .markdownlint.log\n`,

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 146 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
`removing ${path.join(cwd, '.markdownlint-cli2.cjs ...')}`]
const result = await cli(['markdown', '-m full', '-l', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(false)
Expand All @@ -169,7 +169,7 @@ test('markdown -m full -v --format cjs', async () => {
'--------------------------------------------------------------------------------\n',
'FILE: src/subproject/article.md\n',
'src/subproject/article.md:8 validate-internal-links Broken link [invalid local anchor] [Context: "#anchor"]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 20.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 19.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (ubuntu-latest, 18.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 19.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 18.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (macos-latest, 20.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 19.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 18.x)

Strings must use singlequote

Check failure on line 172 in test/linter-cjs.spec.js

View workflow job for this annotation

GitHub Actions / buildAndTest (windows-latest, 20.x)

Strings must use singlequote
const result = await cli(['markdown', '-m full', '-v', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -189,7 +189,7 @@ test('markdown -m full -s alt-src -v --format cjs', async () => {
'alt-src/linter-test-B.md:21 fenced-code-in-quote Fenced code shouldn\'t be in quote\n',
'alt-src/linter-test-B.md:25 validate-internal-links Broken link [image does not exist] [Context: "/red-circle.png"]\n',
'alt-src/linter-test-B.md:29 indented-fence Fenced code shouldn\'t be indented by 1 to 3 spaces [Context: " ```bash"]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-s alt-src', '-v', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -206,7 +206,7 @@ test('markdown -m full -s alt-src -v -c <custom-config-path> --format cjs', asyn
'FILE: alt-src/linter-test-B.md\n',
'alt-src/linter-test-B.md:19 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]\n',
'alt-src/linter-test-B.md:33 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### MD001: Heading levels shou..."]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-s alt-src', '-v', `-c ${customConfigPath}`, '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -223,7 +223,7 @@ test('markdown -m full -s alt-src -v -c <custom-config-path> -a --format cjs', a
'FILE: alt-src/linter-test-B.md\n',
'alt-src/linter-test-B.md:19 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]\n',
'alt-src/linter-test-B.md:33 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### MD001: Heading levels shou..."]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-s alt-src', '-v', `-c ${customConfigPath}`, '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -236,7 +236,7 @@ test('markdown -m full -s no-errors-src -v -c <custom-config-path> -a --format c
const expectedStdout = [
'Checked 1 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-s no-errors-src', '-v', `-c ${customConfigPath}`, '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -249,7 +249,7 @@ test('markdown -m full -f --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 9 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-f', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -262,7 +262,7 @@ test('markdown -m full -f -l --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 9 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`,
`Full markdownlint log see in .markdownlint.log\n`,
`removing ${path.join(cwd, '.markdownlint-cli2.cjs ...')}`]
const result = await cli(['markdown', '-m full', '-f', '-l', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(false)
Expand All @@ -288,7 +288,7 @@ test('markdown -m full -f -v --format cjs', async () => {
'--------------------------------------------------------------------------------\n',
'FILE: src/subproject/article.md\n',
'src/subproject/article.md:8 validate-internal-links Broken link [invalid local anchor] [Context: "#anchor"]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-f', '-v', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -305,7 +305,7 @@ test('markdown -m full -f -v -c <custom-config-path> --format cjs', async () =>
'FILE: src/linter-test-A.md\n',
'src/linter-test-A.md:8 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]\n',
'src/linter-test-A.md:10 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### MD001: Heading levels shou..."]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-f', '-v', `-c ${customConfigPath}`, '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -322,7 +322,7 @@ test('markdown -m full -f -v -c <custom-config-path> -s alt-src --format cjs', a
'FILE: alt-src/linter-test-B.md\n',
'alt-src/linter-test-B.md:19 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]\n',
'alt-src/linter-test-B.md:33 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### MD001: Heading levels shou..."]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-f', '-v', `-c ${customConfigPath}`, '-s alt-src', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -339,7 +339,7 @@ test('markdown -m full -f -v -c <custom-config-path> -s alt-src -a --format cjs'
'FILE: alt-src/linter-test-B.md\n',
'alt-src/linter-test-B.md:19 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]\n',
'alt-src/linter-test-B.md:33 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### MD001: Heading levels shou..."]\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-f', '-v', `-c ${customConfigPath}`, '-s alt-src', '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -352,7 +352,7 @@ test('markdown -m full -f -v -c <custom-config-path> -s no-errors-src -a --forma
const expectedStdout = [
'Checked 1 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m full', '-f', '-v', `-c ${customConfigPath}`, '-s no-errors-src', '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -365,7 +365,7 @@ test('markdown -m typograph --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m typograph', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -378,7 +378,7 @@ test('markdown -m typograph -l --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`,
`Full markdownlint log see in .markdownlint.log\n`,
`removing ${path.join(cwd, '.markdownlint-cli2.cjs ...')}`]
const result = await cli(['markdown', '-m typograph', '-l', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(false)
Expand All @@ -392,7 +392,7 @@ test('markdown -m typograph -v --format cjs', async () => {
const expectedStdout = [
'Checked 2 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m typograph', '-v', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -405,7 +405,7 @@ test('markdown -m typograph -v -c <custom-config-path> --format cjs', async () =
const expectedStdout = [
'Checked 2 files\n',
'Found 2 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m typograph', '-v', `-c ${customConfigPath}`, '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -418,7 +418,7 @@ test('markdown -m typograph -v -c <custom-config-path> -s alt-src --format cjs',
const expectedStdout = [
'Checked 1 files\n',
'Found 2 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m typograph', '-v', `-c ${customConfigPath}`, '-s alt-src', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -431,7 +431,7 @@ test('markdown -m typograph -v -c <custom-config-path> -s alt-src -a --format cj
const expectedStdout = [
'Checked 1 files\n',
'Found 2 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m typograph', '-v', `-c ${customConfigPath}`, '-s alt-src', '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand All @@ -444,7 +444,7 @@ test('markdown -m typograph -v -c <custom-config-path> -s no-errors-src -a --for
const expectedStdout = [
'Checked 1 files\n',
'Found 0 formatting errors\n',
`Full markdownlint log see in ${path.join(cwd, '.markdownlint.log')}\n`]
`Full markdownlint log see in .markdownlint.log\n`]
const result = await cli(['markdown', '-m typograph', '-v', `-c ${customConfigPath}`, '-s no-errors-src', '-a', '--format cjs'], '.')
expect(fs.existsSync(`${cwd}/.markdownlint-cli2.cjs`)).toBe(true)
console.log(result)
Expand Down
Loading

0 comments on commit ccee971

Please sign in to comment.