-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github actions, rubocop, stickler and styelint
- Loading branch information
1 parent
d7ff5f6
commit 1e09a4a
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Linters | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
lighthouse: | ||
name: Lighthouse | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Lighthouse | ||
run: npm install -g @lhci/[email protected] | ||
- name: Lighthouse Report | ||
run: lhci autorun --upload.target=temporary-public-storage --collect.staticDistDir=. | ||
webhint: | ||
name: Webhint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Webhint | ||
run: | | ||
npm install --save-dev [email protected] | ||
[ -f .hintrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css/.hintrc | ||
- name: Webhint Report | ||
run: npx hint --telemetry=off . | ||
stylelint: | ||
name: Stylelint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Stylelint | ||
run: | | ||
npm install --save-dev [email protected] [email protected] [email protected] stylelint-csstree-validator | ||
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.stylelintrc.json | ||
- name: Stylelint Report | ||
run: npx stylelint "**/*.{css,scss}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
AllCops: | ||
Exclude: | ||
- "db/**/*" | ||
- "bin/*" | ||
- "config/**/*" | ||
- "Guardfile" | ||
- "Rakefile" | ||
- "README.md" | ||
- "node_modules/**/*" | ||
|
||
DisplayCopNames: true | ||
|
||
Layout/LineLength: | ||
Max: 120 | ||
Metrics/MethodLength: | ||
Include: | ||
- "app/controllers/*" | ||
- "app/models/*" | ||
Max: 20 | ||
Metrics/AbcSize: | ||
Include: | ||
- "app/controllers/*" | ||
- "app/models/*" | ||
Max: 50 | ||
Metrics/ClassLength: | ||
Max: 150 | ||
Metrics/BlockLength: | ||
ExcludedMethods: ['describe'] | ||
Max: 30 | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
Style/EachForSimpleLoop: | ||
Enabled: false | ||
Style/AndOr: | ||
Enabled: false | ||
Style/DefWithParentheses: | ||
Enabled: false | ||
Style/FrozenStringLiteralComment: | ||
EnforcedStyle: never | ||
|
||
Layout/HashAlignment: | ||
EnforcedColonStyle: key | ||
Layout/ExtraSpacing: | ||
AllowForAlignment: false | ||
Layout/MultilineMethodCallIndentation: | ||
Enabled: true | ||
EnforcedStyle: indented |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# add the linters you want stickler to use for this project | ||
linters: | ||
rubocop: | ||
display_cop_names: true | ||
# indicate where is the config file for stylelint | ||
config: './rubocop.yml' | ||
|
||
# add the files here you want to be ignored by stylelint | ||
files: | ||
ignore: | ||
- "bin/*" | ||
- "db/*" | ||
- "config/*" | ||
- "Guardfile" | ||
- "Rakefile" | ||
- "README.md" | ||
- "node_modules/**/*" | ||
|
||
# PLEASE DO NOT enable auto fixing options | ||
# if you need extra support from you linter - do it in your local env as described in README for this config | ||
|
||
# find full documentation here: https://stickler-ci.com/docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": ["stylelint-config-standard"], | ||
"plugins": ["stylelint-scss"], | ||
"rules": { | ||
"at-rule-no-unknown": null, | ||
"scss/at-rule-no-unknown": true | ||
}, | ||
"ignoreFiles": [ | ||
"build/**", | ||
"dist/**", | ||
"**/reset*.css", | ||
"**/bootstrap*.css" | ||
] | ||
} |