Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Move linting to a dedicated repository #489

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .doclintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
en/
38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

38 changes: 22 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,44 @@ jobs:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
fail-fast: false
matrix:
script: [ 'lint-md', 'lint-js', 'lint-php' ]
name: ${{ matrix.script }}
lint_lang: [ 'lint-md', 'lint-js', 'lint-php' ]
name: ${{ matrix.lint_lang }}
steps:

- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Install PHP
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
with:
php-version: 8.1

- name: Install composer dependencies
run: composer install --prefer-dist --no-progress --ansi --no-interaction --optimize-autoloader

- name: Read .nvmrc
if: ${{ matrix.lint_lang == 'lint-md' || matrix.lint_lang == 'lint-js' }}
id: read-nvm
run: |
NPM_VERSION=$(cat .nvmrc)
NPM_VERSION=$(cat vendor/silverstripe/documentation-lint/.nvmrc)
echo "version=$NPM_VERSION" >> $GITHUB_OUTPUT

- name: Install NPM
if: ${{ matrix.lint_lang == 'lint-md' || matrix.lint_lang == 'lint-js' }}
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: ${{ steps.read-nvm.outputs.version }}

- name: Install yarn dependencies
- name: Install yarn
if: ${{ matrix.lint_lang == 'lint-md' || matrix.lint_lang == 'lint-js' }}
run: |
npm install --global yarn
yarn install

- name: Install PHP
if: ${{ matrix.script == 'lint-php' }}
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
with:
php-version: 8.1

- name: Install composer dependencies
if: ${{ matrix.script == 'lint-php' }}
run: composer install --prefer-dist --no-progress --ansi --no-interaction --optimize-autoloader

- name: Run lint
run: yarn ${{ matrix.script }}
run: |
LINT_LANG=${{ matrix.lint_lang }}
# Use string substitution to pull the "lint-" off the beginning of the `LINT_LANG` variable
# and add the "--with-" prefix so we have the correct flag for the language, e.g. "--with-md" from "lint-md"
FLAG="--with-${LINT_LANG#lint-}"
emteknetnz marked this conversation as resolved.
Show resolved Hide resolved
# Run the script
vendor/bin/doclint $FLAG
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/node_modules/
/vendor/
composer.lock
13 changes: 0 additions & 13 deletions .markdownlint-cli2.mjs

This file was deleted.

154 changes: 0 additions & 154 deletions .markdownlint.yml

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
],
"authors": [
{
"name": "SilverStripe",
"name": "Silverstripe",
"homepage": "https://silverstripe.com"
},
{
"name": "The SilverStripe Community",
"name": "The Silverstripe Community",
emteknetnz marked this conversation as resolved.
Show resolved Hide resolved
"homepage": "https://silverstripe.org"
}
],
"require-dev": {
"silverstripe/markdown-php-codesniffer": "^1",
"slevomat/coding-standard": "^8.14"
"silverstripe/documentation-lint": "^1"
},
"config": {
"allow-plugins": {
Expand Down
20 changes: 0 additions & 20 deletions package.json

This file was deleted.

Loading
Loading