Skip to content

Commit 5f985eb

Browse files
committed
Merge branch '5.1' into 5
2 parents 1a514d1 + 87e27db commit 5f985eb

File tree

246 files changed

+17477
-13470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+17477
-13470
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# For more information about the properties used in
2+
# this file, please see the EditorConfig documentation:
3+
# http://editorconfig.org/
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[composer.json]
14+
indent_size = 4

.eslintrc.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
const rules = require('@silverstripe/eslint-config/.eslintrc');
2+
3+
rules.plugins = ['markdown'];
4+
rules.overrides = [
5+
{
6+
files: ['**/*.md'],
7+
processor: 'markdown/markdown'
8+
},
9+
{
10+
files: ['**/*.md/*.js'],
11+
parserOptions: {
12+
ecmaFeatures: {
13+
impliedStrict: true
14+
}
15+
},
16+
settings: {
17+
react: {
18+
version: '16'
19+
}
20+
},
21+
rules: {
22+
// These rules are not appropriate for linting markdown code blocks
23+
'lines-around-comment': 'off',
24+
'import/no-unresolved': 'off',
25+
'import/extensions': 'off',
26+
'react/jsx-no-undef': 'off',
27+
'no-undef': 'off',
28+
'no-unused-expressions': 'off',
29+
'no-unused-vars': 'off',
30+
'brace-style': 'off', // it's useful to have comments before the else block
31+
// These rules are disabled because they are difficult to adhere to right now
32+
'jsx-a11y/label-has-associated-control': 'off',
33+
'react/prefer-stateless-function': 'off',
34+
}
35+
}
36+
];
37+
38+
module.exports = rules;

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
ci:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
# set fail-fast to false prevent one matrix job from cancelling other matrix jobs
13+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
14+
fail-fast: false
15+
matrix:
16+
script: [ 'lint-md', 'lint-js', 'lint-php' ]
17+
name: ${{ matrix.script }}
18+
steps:
19+
20+
- name: Checkout code
21+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
22+
23+
- name: Read .nvmrc
24+
id: read-nvm
25+
run: |
26+
NPM_VERSION=$(cat .nvmrc)
27+
echo "version=$NPM_VERSION" >> $GITHUB_OUTPUT
28+
29+
- name: Install NPM
30+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
31+
with:
32+
node-version: ${{ steps.read-nvm.outputs.version }}
33+
34+
- name: Install yarn dependencies
35+
run: |
36+
npm install --global yarn
37+
yarn install
38+
39+
- name: Install PHP
40+
if: ${{ matrix.script == 'lint-php' }}
41+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
42+
with:
43+
php-version: 8.1
44+
45+
- name: Install composer dependencies
46+
if: ${{ matrix.script == 'lint-php' }}
47+
run: composer install --prefer-dist --no-progress --ansi --no-interaction --optimize-autoloader
48+
49+
- name: Run lint
50+
run: yarn ${{ matrix.script }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules/
2+
/vendor/
3+
composer.lock

.markdownlint-cli2.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import markdownlint from 'markdownlint';
3+
import enhancedProperNames from 'markdownlint-rule-enhanced-proper-names/src/enhanced-proper-names.js';
4+
import titleCaseStyle from 'markdownlint-rule-title-case-style';
5+
import { load } from 'js-yaml';
6+
7+
export default {
8+
'customRules': [
9+
enhancedProperNames,
10+
titleCaseStyle,
11+
],
12+
'config': markdownlint.readConfigSync('./.markdownlint.yml', [ load ]),
13+
};

.markdownlint.yml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Enable all rules with default settings as a baseline
2+
default: true
3+
4+
# MD041: Ignore the frontmatter (metadata) title when checking for H1s
5+
first-line-h1:
6+
front_matter_title: ''
7+
8+
# MD025: Ignore the frontmatter (metadata) title when checking for H1s
9+
single-h1:
10+
front_matter_title: ''
11+
12+
# MD003: Enforce ATX style headings
13+
heading-style:
14+
style: 'atx'
15+
16+
# MD049: Use asterisks for italics
17+
emphasis-style:
18+
style: 'asterisk'
19+
20+
# MD050: Use asterisks for bold
21+
strong-style:
22+
style: 'asterisk'
23+
24+
# MD004: Use hyphens for unordered lists
25+
ul-style:
26+
style: 'dash'
27+
28+
# MD029: Always use 1. for ordered lists
29+
ol-prefix:
30+
style: 'one'
31+
32+
# MD013: Disable line-length rule for now as it touches too many lines of doc
33+
line-length: false
34+
# line_length: 120
35+
36+
# MD010: Use two spaces for each tab (default was 1)
37+
no-hard-tabs:
38+
spaces_per_tab: 2
39+
40+
# MD031: Don't require empty lines after code blocks in lists
41+
blanks-around-fences:
42+
list_items: false
43+
44+
# MD035: Enforce a style for horizontal rules.
45+
# Hyphens would be confusing since we use those for frontmatter (metadata)
46+
hr-style:
47+
style: '___'
48+
49+
# MD046: Don't allow indented codeblocks
50+
code-block-style:
51+
style: 'fenced'
52+
53+
# MD048: Use backticks for codeblocks
54+
code-fence-style:
55+
style: 'backtick'
56+
57+
# MD040: Explicitly only allow some languages for code blocks
58+
# This helps with consistency (e.g. avoid having both yml and yaml)
59+
fenced-code-language:
60+
language_only: true
61+
allowed_languages:
62+
- 'bash' # use this instead of shell or env
63+
- 'css'
64+
- 'diff'
65+
- 'graphql'
66+
- 'html'
67+
- 'js'
68+
- 'json'
69+
- 'php'
70+
- 'scss'
71+
- 'ss'
72+
- 'sql'
73+
- 'text'
74+
- 'xml'
75+
- 'yml'
76+
77+
# MD044: Disable in favour of the enhanced version which ignores custom anchors for headings
78+
# markdownlint-rule-enhanced-proper-names: Enforces capitalisation for specific names
79+
proper-names: off
80+
enhanced-proper-names:
81+
code_blocks: false
82+
heading_id: false
83+
names:
84+
- 'API'
85+
- 'type/api-break' # the GitHub label
86+
- 'CI'
87+
- 'CMS'
88+
- '/cms' # e.g. "silverstripe/cms"
89+
- '-cms' # e.g. "silverstripe/recipe-cms"
90+
- 'CSS'
91+
- 'GitHub'
92+
- 'GraphQL'
93+
- '/graphql' # e.g. "silverstripe/graphql"
94+
- 'HTTP'
95+
- 'JavaScript'
96+
- 'JS'
97+
- '.js' # e.g. "Node.js"
98+
- 'jQuery'
99+
- 'ORM'
100+
- 'PHP'
101+
- 'php-' # e.g. "php-intl extension"
102+
- 'SCSS'
103+
- 'Silverstripe'
104+
- 'silverstripe/' # e.g. "silverstripe/framework"
105+
- 'silverstripe-' # e.g. "silverstripe-vendormodule"
106+
- '@silverstripe.org'
107+
- 'TinyMCE'
108+
- 'UI'
109+
- 'URL'
110+
- 'YAML'
111+
112+
# markdownlint-rule-title-case-style: Use sentence-style headings
113+
title-case-style:
114+
case: 'sentence'
115+
# commas in the following list are intentional and necessary since the plugin makes no distinction
116+
# between words and punctuation
117+
ignore:
118+
- 'Apache'
119+
- 'APIs'
120+
- 'Composer'
121+
- 'CTE'
122+
- 'GitHub'
123+
- 'GraphQL'
124+
- 'Huntr'
125+
- 'JavaScript'
126+
- 'I'
127+
- 'InnoDB'
128+
- 'Git'
129+
- 'jQuery'
130+
- 'jQuery,'
131+
- 'Lighttpd'
132+
- 'MyISAM'
133+
- 'MySQL'
134+
- 'Nginx'
135+
- 'Nginx,'
136+
- 'PHPUnit'
137+
- 'RFCs'
138+
- 'Silverstripe'
139+
- 'TinyMCE'
140+
- 'Transifex'
141+
- 'URLs'
142+
- 'WebP'
143+
144+
# MD033: Allow specific HTML tags
145+
no-inline-html:
146+
allowed_elements:
147+
# br is necessary for new lines in tables
148+
- 'br'
149+
# accordians are okay
150+
- 'details'
151+
- 'summary'
152+
# description lists are okay
153+
- 'dl'
154+
- 'dd'
155+
- 'dt'

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

composer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@
1919
"name": "The SilverStripe Community",
2020
"homepage": "https://silverstripe.org"
2121
}
22-
]
22+
],
23+
"require-dev": {
24+
"silverstripe/markdown-php-codesniffer": "^1",
25+
"slevomat/coding-standard": "^8.14"
26+
},
27+
"config": {
28+
"allow-plugins": {
29+
"dealerdirect/phpcodesniffer-composer-installer": true
30+
}
31+
}
2332
}

0 commit comments

Comments
 (0)