mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-27 15:15:23 +00:00
Updated Wiki content
25
.github/workflows/validate_list_indentation.yml
vendored
25
.github/workflows/validate_list_indentation.yml
vendored
@@ -16,6 +16,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
env:
|
||||||
|
ERROR_BLOCK: ''
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
@@ -91,17 +93,17 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (failures.length) {
|
if (failures.length) {
|
||||||
let errorMessage = 'Invalid list indentation found:\n\n';
|
const lines = failures.map((failure) => {
|
||||||
failures.forEach(failure => {
|
return `${failure.filePath} line ${failure.line}: indentation is ${failure.indentation} spaces (must be 0 or a multiple of 4)`;
|
||||||
errorMessage += `${failure.filePath}:${failure.line} - Indentation: ${failure.indentation} spaces (must be 0 or a multiple of 4)\n`;
|
|
||||||
errorMessage += ` "${failure.content}"\n\n`;
|
|
||||||
});
|
});
|
||||||
|
const block = lines.join('\n');
|
||||||
core.setFailed(errorMessage);
|
core.exportVariable('ERROR_BLOCK', block);
|
||||||
} else {
|
return;
|
||||||
core.info(`Validated list indentation in ${filesToCheck.length} file(s). All valid.`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.exportVariable('ERROR_BLOCK', '');
|
||||||
|
core.info(`Validated list indentation in ${filesToCheck.length} file(s). All valid.`);
|
||||||
|
|
||||||
function collectAllMarkdownFiles(relativeDir) {
|
function collectAllMarkdownFiles(relativeDir) {
|
||||||
const files = [];
|
const files = [];
|
||||||
const absoluteDir = relativeDir ? path.join(workspace, relativeDir) : workspace;
|
const absoluteDir = relativeDir ? path.join(workspace, relativeDir) : workspace;
|
||||||
@@ -129,3 +131,10 @@ jobs:
|
|||||||
|
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- name: Show invalid list indentation
|
||||||
|
if: env.ERROR_BLOCK != ''
|
||||||
|
run: |
|
||||||
|
echo 'Invalid list indentation:'
|
||||||
|
printf "\`\`\`\n%s\n\`\`\`\n" "${{ env.ERROR_BLOCK }}"
|
||||||
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user