-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduces MegaLinter * Enable: DOCKERFILE_HADOLINT * Fix: DOCKERFILE_HADOLINT findings * Enable: JSON_PRETTIER * Fix: JSON_PRETTIER findings * Enable: SPELL_MISSPELL * Fix: SPELL_MISSPELL * Enable: TERRAFORM_TFLINT * Fix: TERRAFORM_TFLINT https://github.com/terraform-linters/tflint/blob/v0.35.0/docs/rules/terraform_deprecated_interpolation.md * Enable: YAML_YAMLLINT * Fix: YAML_YAMLLINT * Enable: JAVASCRIPT_STANDARD * Fix: JAVASCRIPT_STANDARD findings * Update build badges * Update CONTRIBUTING.md with editorconf and megalinter instructions
- Loading branch information
1 parent
fb26bcd
commit 8c8fc95
Showing
17 changed files
with
189 additions
and
63 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
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,71 @@ | ||
--- | ||
# MegaLinter GitHub Action configuration file | ||
# More info at https://oxsecurity.github.io/megalinter | ||
name: MegaLinter | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
APPLY_FIXES: none | ||
APPLY_FIXES_EVENT: pull_request | ||
APPLY_FIXES_MODE: pull_request | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: MegaLinter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: MegaLinter | ||
id: ml | ||
uses: oxsecurity/megalinter@v6 | ||
env: | ||
# All available variables are described in documentation | ||
# https://oxsecurity.github.io/megalinter/configuration/ | ||
VALIDATE_ALL_CODEBASE: true | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Archive production artifacts | ||
if: ${{ success() }} || ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: MegaLinter reports | ||
path: | | ||
megalinter-reports | ||
mega-linter.log | ||
# Create pull request if applicable (this only works on PRs from the same repository, not from forks) | ||
- name: Create Pull Request with applied fixes | ||
id: cpr | ||
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
commit-message: "[MegaLinter] Apply linters automatic fixes" | ||
title: "[MegaLinter] Apply linters automatic fixes" | ||
labels: bot | ||
- name: Create PR output | ||
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | ||
# Push new commit if applicable (this only works on PRs from the same repository, not from forks) | ||
- name: Prepare commit | ||
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') | ||
run: sudo chown -Rc $UID .git/ | ||
- name: Commit and push applied linter fixes | ||
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix') | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} | ||
commit_message: "[MegaLinter] Apply linters fixes" |
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 |
---|---|---|
|
@@ -137,3 +137,5 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
megalinter-reports/ |
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,32 @@ | ||
# Configuration file for MegaLinter | ||
# See all available variables at https://oxsecurity.github.io/megalinter/configuration/ and in linters documentation | ||
|
||
# all, none, or list of linter keys | ||
APPLY_FIXES: none | ||
|
||
# If you use ENABLE variable, all other languages/formats/tooling-formats will be disabled by default | ||
# ENABLE: | ||
|
||
# If you use ENABLE_LINTERS variable, all other linters will be disabled by default | ||
ENABLE_LINTERS: | ||
- CLOUDFORMATION_CFN_LINT | ||
- DOCKERFILE_HADOLINT | ||
- JSON_JSONLINT | ||
- JSON_PRETTIER | ||
- JSON_V8R | ||
- JAVASCRIPT_STANDARD | ||
- SPELL_MISSPELL | ||
- TERRAFORM_TFLINT | ||
- YAML_YAMLLINT | ||
|
||
# DISABLE: | ||
# - COPYPASTE # Comment to enable checks of excessive copy-pastes | ||
# - SPELL # Comment to enable checks of spelling mistakes | ||
|
||
SHOW_ELAPSED_TIME: true | ||
FILEIO_REPORTER: false | ||
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass | ||
|
||
JSON_PRETTIER_PRE_COMMANDS: | ||
- command: npm install [email protected] | ||
cwd: "workspace" |
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,8 @@ | ||
module.exports = { | ||
plugins: [ | ||
'/node-deps/node_modules/prettier-plugin-multiline-arrays' | ||
], | ||
trailingComma: 'es5', | ||
semi: false, | ||
singleQuote: true | ||
} |
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
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
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
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
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
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
FROM node:latest | ||
|
||
ADD . . | ||
|
||
FROM node:current-alpine | ||
WORKDIR /app | ||
COPY . . | ||
RUN npm install | ||
|
||
EXPOSE 3000 | ||
|
||
ENTRYPOINT ["npm", "start"] | ||
ENTRYPOINT ["npm", "start"] |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
const express = require('express'); | ||
const express = require('express') | ||
|
||
const app = express(); | ||
const app = express() | ||
|
||
app.set('view engine', 'ejs'); | ||
app.use(express.static('public')); | ||
app.set('view engine', 'ejs') | ||
app.use(express.static('public')) | ||
|
||
app.get('/', (req, res) => { | ||
res.render('index', { | ||
region: process.env.REGION, | ||
environment: process.env.ENVIRONMENT | ||
}); | ||
}); | ||
}) | ||
}) | ||
|
||
app.get('/version', (req, res) => { | ||
res.json({"version": "0.0.1"}); | ||
}); | ||
res.json({ version: '0.0.1' }) | ||
}) | ||
|
||
app.listen(3000, () => { | ||
console.log('Listening on 3000'); | ||
}); | ||
console.log('Listening on 3000') | ||
}) |
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
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
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
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 |
---|---|---|
|
@@ -11,10 +11,8 @@ | |
] | ||
}, | ||
"enforced_for": { | ||
"@@assign": [ | ||
"s3:bucket" | ||
] | ||
"@@assign": ["s3:bucket"] | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.