Skip to content
代码片段 群组 项目
提交 ee952ed2 编辑于 作者: Evan Read's avatar Evan Read
浏览文件

Remove markdownlint tests for former tabs syntax

上级 80ea4f43
分支
标签
无相关合并请求
...@@ -162,8 +162,3 @@ config: ...@@ -162,8 +162,3 @@ config:
] ]
ignores: ignores:
- "doc/architecture" - "doc/architecture"
customRules:
- "./doc/.markdownlint/rules/tabs_blank_lines.js"
- "./doc/.markdownlint/rules/tabs_title_markup.js"
- "./doc/.markdownlint/rules/tabs_title_text.js"
- "./doc/.markdownlint/rules/tabs_wrapper_tags.js"
const { forEachLine, getLineMetadata, isBlankLine } = require(`markdownlint-rule-helpers`);
module.exports = {
names: ['tabs-blank-lines'],
description: 'Tab elements must be surrounded by blank lines',
tags: ['gitlab-docs', 'tabs'],
function: (params, onError) => {
const tabElements = ['::Tabs', '::EndTabs', ':::TabTitle'];
forEachLine(getLineMetadata(params), (line, lineIndex) => {
const lineHasTab = tabElements.includes(line.split(' ')[0]);
const prevLine = params.lines[lineIndex - 1];
const nextLine = params.lines[lineIndex + 1];
if (lineHasTab && (!isBlankLine(prevLine) || !isBlankLine(nextLine))) {
onError({
lineNumber: lineIndex + 1,
});
}
});
},
};
const { forEachLine, getLineMetadata } = require(`markdownlint-rule-helpers`);
module.exports = {
names: ['tabs-title-markup'],
description: 'Incorrect number of colon characters for tag',
information: new URL('https://docs.gitlab.com/development/documentation/styleguide/#tabs'),
tags: ['gitlab-docs', 'tabs'],
function: (params, onError) => {
// Note the correct number of colons in each tab tag type.
const wrapperColons = 2;
const titleColons = 3;
forEachLine(getLineMetadata(params), (line, lineIndex) => {
// Get the number of colons in this line.
const colonCount = [...line].filter((x) => x === ':').length;
// Throw an error in the case of a mismatch.
if (
((line.includes(':Tabs') || line.includes(':EndTabs')) && colonCount !== wrapperColons) ||
(line.includes(':TabTitle') && colonCount !== titleColons)
) {
const correctColonCount = line.includes(':TabTitle') ? wrapperColons : titleColons;
onError({
lineNumber: lineIndex + 1,
detail: `Actual: ${colonCount}; Expected: ${correctColonCount}`,
});
}
});
},
};
const { forEachLine, getLineMetadata, isBlankLine } = require(`markdownlint-rule-helpers`);
module.exports = {
names: ['tabs-title-text'],
description: 'Tab without title text',
information: new URL('https://docs.gitlab.com/development/documentation/styleguide/#tabs'),
tags: ['gitlab-docs', 'tabs'],
function: (params, onError) => {
forEachLine(getLineMetadata(params), (line, lineIndex) => {
if (!isBlankLine(line) && line.replace(':::TabTitle', '').trim() === '') {
onError({
lineNumber: lineIndex + 1,
detail: 'Expected: :::TabTitle <your title here>; Actual: :::TabTitle',
});
}
});
},
};
module.exports = {
names: ['tabs-wrapper-tags'],
description: 'Unequal number of tab start and end tags',
information: new URL('https://docs.gitlab.com/development/documentation/styleguide/#tabs'),
tags: ['gitlab-docs', 'tabs'],
function: function rule(params, onError) {
const tabStarts = params.lines.filter((line) => line === '::Tabs');
const tabEnds = params.lines.filter((line) => line === '::EndTabs');
if (tabStarts.length !== tabEnds.length) {
const errorIndex =
params.lines.indexOf('::Tabs') > 0
? params.lines.indexOf('::Tabs')
: params.lines.indexOf('::EndTabs');
onError({
lineNumber: errorIndex + 1,
detail: `Opening tags: ${tabStarts.length}; Closing tags: ${tabEnds.length}`,
});
}
},
};
...@@ -169,14 +169,14 @@ Finally, push to GitLab and let the tests begin! ...@@ -169,14 +169,14 @@ Finally, push to GitLab and let the tests begin!
### Test against different PHP versions in Shell builds ### Test against different PHP versions in Shell builds
The [phpenv](https://github.com/phpenv/phpenv) project allows you to easily manage different versions of PHP The [phpenv](https://github.com/phpenv/phpenv) project allows you to manage different versions of PHP
each with its own configuration. This is especially useful when testing PHP projects each with its own configuration. This is especially useful when testing PHP projects
with the Shell executor. with the Shell executor.
You have to install it on your build machine under the `gitlab-runner` You have to install it on your build machine under the `gitlab-runner`
user following [the upstream installation guide](https://github.com/phpenv/phpenv#installation). user following [the upstream installation guide](https://github.com/phpenv/phpenv#installation).
Using phpenv also allows to easily configure the PHP environment with: Using phpenv also allows you to configure the PHP environment with:
```shell ```shell
phpenv config-add my_config.ini phpenv config-add my_config.ini
......
...@@ -1419,7 +1419,7 @@ ...@@ -1419,7 +1419,7 @@
resolved "https://registry.yarnpkg.com/@gitlab/fonts/-/fonts-1.3.0.tgz#df89c1bb6714e4a8a5d3272568aa4de7fb337267" resolved "https://registry.yarnpkg.com/@gitlab/fonts/-/fonts-1.3.0.tgz#df89c1bb6714e4a8a5d3272568aa4de7fb337267"
integrity sha512-DoMUIN3DqjEn7wvcxBg/b7Ite5fTdF5EmuOZoBRo2j0UBGweDXmNBi+9HrTZs4cBU660dOxcf1hATFcG3npbPg== integrity sha512-DoMUIN3DqjEn7wvcxBg/b7Ite5fTdF5EmuOZoBRo2j0UBGweDXmNBi+9HrTZs4cBU660dOxcf1hATFcG3npbPg==
   
"@gitlab/noop@^1.0.1", jackspeak@^3.1.2, "jackspeak@npm:@gitlab/noop@1.0.1": "@gitlab/noop@^1.0.1":
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/@gitlab/noop/-/noop-1.0.1.tgz#71a831146ee02732b4a61d2d3c11204564753454" resolved "https://registry.yarnpkg.com/@gitlab/noop/-/noop-1.0.1.tgz#71a831146ee02732b4a61d2d3c11204564753454"
integrity sha512-s++4wjMYeDvBp9IO59DBrWjy8SE/gFkjTDO5ck2W0S6Vv7OlqgErwL7pHngAnrSmTJAzyUG8wHGqo0ViS4jn5Q== integrity sha512-s++4wjMYeDvBp9IO59DBrWjy8SE/gFkjTDO5ck2W0S6Vv7OlqgErwL7pHngAnrSmTJAzyUG8wHGqo0ViS4jn5Q==
...@@ -9400,6 +9400,11 @@ iterall@^1.2.1: ...@@ -9400,6 +9400,11 @@ iterall@^1.2.1:
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea"
integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==
   
jackspeak@^3.1.2, "jackspeak@npm:@gitlab/noop@1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@gitlab/noop/-/noop-1.0.1.tgz#71a831146ee02732b4a61d2d3c11204564753454"
integrity sha512-s++4wjMYeDvBp9IO59DBrWjy8SE/gFkjTDO5ck2W0S6Vv7OlqgErwL7pHngAnrSmTJAzyUG8wHGqo0ViS4jn5Q==
jed@^1.1.1: jed@^1.1.1:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/jed/-/jed-1.1.1.tgz#7a549bbd9ffe1585b0cd0a191e203055bee574b4" resolved "https://registry.yarnpkg.com/jed/-/jed-1.1.1.tgz#7a549bbd9ffe1585b0cd0a191e203055bee574b4"
...@@ -10343,18 +10348,6 @@ markdownlint-cli2@^0.17.1: ...@@ -10343,18 +10348,6 @@ markdownlint-cli2@^0.17.1:
markdownlint-cli2-formatter-default "0.0.5" markdownlint-cli2-formatter-default "0.0.5"
micromatch "4.0.8" micromatch "4.0.8"
   
markdownlint-micromark@0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/markdownlint-micromark/-/markdownlint-micromark-0.1.2.tgz#5520e04febffa46741875a2f297509ffdb561f5c"
integrity sha512-jRxlQg8KpOfM2IbCL9RXM8ZiYWz2rv6DlZAnGv8ASJQpUh6byTBnEsbuMZ6T2/uIgntyf7SKg/mEaEBo1164fQ==
markdownlint-rule-helpers@^0.25.0:
version "0.25.0"
resolved "https://registry.yarnpkg.com/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.25.0.tgz#700e22715c3b02bc364914d9b15674b99eeb7c5f"
integrity sha512-2vH6ee3UCPUuKVOxrinHxCT4bLjpCLRdtzTu4UO7Qb4Gl2vlGb70Un8byDv8dyJ8ZqZtxANd2XxvAumoG2nYcw==
dependencies:
markdownlint-micromark "0.1.2"
markdownlint@0.37.3: markdownlint@0.37.3:
version "0.37.3" version "0.37.3"
resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.37.3.tgz#061ac5462e97fedc7a96aaac5c132885e4161bfd" resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.37.3.tgz#061ac5462e97fedc7a96aaac5c132885e4161bfd"
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
想要评论请 注册