Skip to content

Commit 2fa03b0

Browse files
authored
feat: add additional linters (#60)
* feat: add additional linters
1 parent 3942fdd commit 2fa03b0

Some content is hidden

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

68 files changed

+8974
-5849
lines changed

.github/actions/bundle-gh-page/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'Bundle GitHub Page'
23
description: 'This action bundles the current gh-page branch with the out folder'
34
inputs:

.github/actions/download-tar-artifact/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'Download Tar Artifact'
23
description: 'Downloads an artifact and unzips it'
34
inputs:

.github/actions/npm-cache/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'NPM Cache Action'
23
description: 'Initialize NPM Cache'
34
inputs:

.github/actions/upload-tar-artifact/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'Upload Tar Artifact'
23
description: 'Upload an artifact and zips it as {name}.tar.gz'
34
inputs:

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: 2
23
updates:
34
- package-ecosystem: 'github-actions'

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# Add 'repo' label to any root file changes
23
repo:
34
- '*'

.github/workflows/00-init.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Init Workflow
23

34
on:

.github/workflows/01-build-all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build Pages
23

34
on:

.github/workflows/01-build-showcases.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build Showcases
23

34
on:

.github/workflows/01-build-stencil-targets.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build Stencil Targets
23

34
on:

.github/workflows/01-build-storybook.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build Storybook
23

34
on:

.github/workflows/01-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 🔬 Run unit/snapshot tests
23

34
on:

.github/workflows/01-validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 🔬 Validate repo
23

34
on:
@@ -19,3 +20,5 @@ jobs:
1920
node ./scripts/cypress-component-check.js
2021
node ./scripts/angular-module-component-check.js
2122
npm run lint:eslint
23+
npm run lint:stylelint
24+
npm run lint:markdownlint

.github/workflows/02-cypress.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Run Cypress on repo
23

34
on:

.github/workflows/03-deploy-gh-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Deploy to gh-pages
23

34
on:

.github/workflows/03-npm-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Publish NPM Repo
23

34
on:

.github/workflows/auto-merge.yml renamed to .github/workflows/99-auto-merge.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1+
---
12
name: Dependabot auto-merge
2-
on: pull_request
3-
4-
permissions:
5-
pull-requests: write
3+
on:
4+
workflow_call:
65

76
jobs:
87
dependabot:
98
runs-on: ubuntu-latest
109
if: ${{ github.actor == 'dependabot[bot]' }}
1110
steps:
12-
- name: Dependabot metadata
11+
- name: Dependabot metadata
1312
id: metadata
1413
uses: dependabot/[email protected]
1514
with:
1615
github-token: '${{ secrets.GITHUB_TOKEN }}'
17-
- name: Approve a PR
16+
- name: Approve a PR
1817
run: gh pr review --approve "$PR_URL"
1918
env:
2019
PR_URL: ${{github.event.pull_request.html_url}}
2120
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
22-
- name: Enable auto-merge for Dependabot PRs
21+
- name: 🤖 Enable auto-merge for Dependabot PRs
2322
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
2423
run: gh pr merge --auto --merge "$PR_URL"
2524
env:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: 'CodeQL'
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
analyze:
8+
name: Analyze
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
language: ['javascript']
14+
15+
steps:
16+
- name: ⬇ Checkout repo
17+
uses: actions/checkout@v3
18+
19+
- name: 🔄 Initialize CodeQL
20+
uses: github/codeql-action/init@v2
21+
with:
22+
languages: ${{ matrix.language }}
23+
24+
- name: 🔨 Autobuild
25+
uses: github/codeql-action/autobuild@v2
26+
27+
- name: 🔎 Perform CodeQL Analysis
28+
uses: github/codeql-action/analyze@v2
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
---
12
name: 'Dependency Review'
2-
on: [pull_request]
3-
4-
permissions:
5-
contents: read
3+
on:
4+
workflow_call:
65

76
jobs:
87
dependency-review:
98
runs-on: ubuntu-latest
109
steps:
11-
- name: 'Checkout Repository'
10+
- name: Checkout repo
1211
uses: actions/checkout@v3
13-
- name: 'Dependency Review'
12+
- name: 🔎 Dependency Review
1413
uses: actions/dependency-review-action@v2
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
---
12
name: 'Pull Request Labeler'
2-
on: [pull_request]
3+
on:
4+
workflow_call:
35

46
jobs:
57
triage:
6-
permissions:
7-
contents: read
8-
pull-requests: write
98
runs-on: ubuntu-latest
109
steps:
11-
- uses: actions/labeler@v4
10+
- name: 🏷️ Labeler
11+
uses: actions/labeler@v4
1212
with:
1313
repo-token: '${{ secrets.GITHUB_TOKEN }}'
1414
sync-labels: true

.github/workflows/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
---
12
name: Cleans all preview pages for gh-pages
23

34
on:
45
push:
56
branches:
67
- main
7-
- develop
88

99
jobs:
1010
clean:

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/default.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Test and deploy to GitHub Pages
1+
---
2+
name: Default On-Push
23

34
on: [push]
45

.github/workflows/pull-request.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Default On-Pull-Request
3+
4+
on:
5+
pull_request:
6+
branches: ['main']
7+
8+
permissions:
9+
pull-requests: write
10+
contents: read
11+
actions: read
12+
security-events: write
13+
14+
jobs:
15+
dependabot:
16+
uses: ./.github/workflows/99-auto-merge.yml
17+
18+
codeql:
19+
uses: ./.github/workflows/99-codeql-analysis.yml
20+
21+
dependency-review:
22+
uses: ./.github/workflows/99-dependency-review.yml
23+
24+
labeler:
25+
uses: ./.github/workflows/99-labeler.yml

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ npx --yes pretty-quick --staged
55
node ./scripts/cypress-component-check.js
66
node ./scripts/angular-module-component-check.js
77
npm run lint:eslint
8+
npm run lint:stylelint
9+
npm run lint:markdownlint
810
npx validate-branch-name
11+

.markdown-lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
###########################
3+
###########################
4+
## Markdown Linter rules ##
5+
###########################
6+
###########################
7+
8+
# Linter rules doc:
9+
# - https://github.com/DavidAnson/markdownlint
10+
#
11+
# Note:
12+
# To comment out a single error:
13+
# <!-- markdownlint-disable -->
14+
# any violations you want
15+
# <!-- markdownlint-restore -->
16+
#
17+
18+
###############
19+
# Rules by id #
20+
###############
21+
MD004: false # Unordered list style
22+
MD007:
23+
indent: 2 # Unordered list indentation
24+
MD013:
25+
line_length: 500 # Line length 80 is far to short
26+
MD024: false #/no-duplicate-heading/no-duplicate-header
27+
MD026:
28+
punctuation: '.,;:!。,;:' # List of not allowed
29+
MD029: false # Ordered list item prefix
30+
MD033: false # Allow inline HTML
31+
MD036: false # Emphasis used instead of a heading
32+
MD049: false # emphasis-style Emphasis style should be consistent
33+
34+
#################
35+
# Rules by tags #
36+
#################
37+
blank_lines: false # Error on blank lines

.markdownlintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/node_modules/**
2+
packages/db-ui-elements-stencil/src/components/**

.stylelintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": [
3+
"stylelint-config-standard-scss",
4+
"stylelint-config-prettier-scss"
5+
],
6+
"rules": {
7+
"at-rule-no-unknown": null,
8+
"scss/at-rule-no-unknown": true,
9+
"scss/at-extend-no-missing-placeholder": null,
10+
"scss/at-mixin-argumentless-call-parentheses": null
11+
}
12+
}

.yamllint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extends: default
2+
3+
rules:
4+
line-length:
5+
max: 120
6+
level: warning

.yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
extends: default
23

34
ignore: |

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Contributing
2+
13
Thanks for your interest in our project. Contributions are welcome. Feel free to [open an issue](https://github.com/db-ui/elements/issues/new) with questions or reporting ideas and bugs, or [open pull requests](https://github.com/db-ui/elements/compare) to contribute code.
24

35
We are committed to fostering a welcoming, respectful, and harassment-free environment. Be kind!

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ If you miss a component than [contribute](CONTRIBUTING.md), please.
6363

6464
## Deutsche Bahn brand
6565

66-
As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound to clear guidelines and restrictions even when being used with the code that we're providing with this product; Deutsche Bahn fully reserves all rights and ownership regarding the Deutsche Bahn brand, even though that we're providing the code of DB UI products free to use and release it under the Apache 2.0 license.
67-
Please have a look at our brand portal at <https://marketingportal.extranet.deutschebahn.com/> for any further questions and whom to contact on any brand issues. As these assets and visual guidelines are retrieved from our Deutsche Bahn Marketingportal, you'll agree with the ["Allgemeine Nutzungsbedingungen für das DB-Marketingportal" (german)](https://marketingportal.extranet.deutschebahn.com/de/nutzungsbedingungen) in case of using them.
66+
As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound to clear guidelines and restrictions even when being used with the code that we're providing with this product.
67+
Deutsche Bahn fully reserves all rights and ownership regarding the Deutsche Bahn brand, even though that we're providing the code of DB UI products free to use and release it under the Apache 2.0 license.
68+
Please have a look at our brand portal at <https://marketingportal.extranet.deutschebahn.com/> for any further questions and whom to contact on any brand issues.
69+
70+
As these assets and visual guidelines are retrieved from our Deutsche Bahn Marketingportal, you'll agree with the ["Allgemeine Nutzungsbedingungen für das DB-Marketingportal" (german)](https://marketingportal.extranet.deutschebahn.com/de/nutzungsbedingungen) in case of using them.
6871

6972
For any usage outside of Deutsche Bahn websites and applications you must remove or replace any Deutsche Bahn brand and design assets as well as protected characteristics and trademarks. We're even also planning to provide a neutral theme that would make it much easier for you to use our product without the trademarks by Deutsche Bahn.
7073

doc/adr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Internal ADRs
1+
# Internal ADRs
22

33
We've removed totally internal ADRs e.g. regarding tool setups etc. that we either don't want to publish or that are obsolete after publishing to GitHub.
44

0 commit comments

Comments
 (0)