-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added linters to the project for all lang
- Loading branch information
1 parent
888df10
commit 1e2c215
Showing
9 changed files
with
7,250 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,23 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: ["airbnb-base"], | ||
parserOptions: { | ||
ecmaVersion: 12, | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
"max-len": ["error", { code: 120 }], // Limit lines to 120 characters | ||
indent: ["error", 2], // Use 2 spaces for indentation | ||
"no-tabs": "error", // Disallow tabs | ||
"linebreak-style": ["error", "unix"], // Enforce Unix line endings | ||
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }], // Ignore unused function arguments starting with underscore (_) | ||
"no-console": "off", // Allow console statements | ||
"comma-dangle": ["error", "never"], // Disallow trailing commas in arrays and objects | ||
"arrow-parens": ["error", "as-needed"], // Require parentheses around arrow function parameters only when needed | ||
"object-curly-spacing": ["error", "always"], // Require spaces inside curly braces of objects | ||
quotes: ["error", "double", { avoidEscape: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Linting | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: npm ci # For JavaScript linting (replace with your package manager command) | ||
|
||
- name: Run ESLint | ||
run: npx eslint . --ext .js | ||
|
||
- name: Run HTMLHint | ||
run: npx htmlhint . | ||
|
||
- name: Run Stylelint | ||
run: npx stylelint . | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Python dependencies | ||
run: pip install -r requirements.txt # For Python linting (replace with your command) | ||
|
||
- name: Run Pylint | ||
run: pylint . |
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 |
---|---|---|
|
@@ -132,3 +132,5 @@ data/certbot/ | |
|
||
container_logs | ||
|
||
# node modules | ||
node_modules/ |
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,21 @@ | ||
{ | ||
"tagname-lowercase": true, // Enforce lowercase tag names | ||
"attr-lowercase": true, // Enforce lowercase attribute names | ||
"attr-value-double-quotes": true, // Require double quotes for attribute values | ||
"attr-value-not-empty": true, // Disallow empty attribute values | ||
"doctype-first": true, // Require the doctype declaration to be the first line | ||
"tag-pair": true, // Require opening and closing tags to be paired | ||
"tag-self-close": true, // Allow self-closing tags | ||
"spec-char-escape": true, // Require escaping special characters | ||
"id-unique": true, // Require unique IDs | ||
"src-not-empty": true, // Disallow empty src attribute values | ||
"alt-require": true, // Require alt attributes for images | ||
"space-tab-mixed-disabled": "space", // Disallow mixed spaces and tabs, enforce spaces | ||
"id-class-value": "dash", // Enforce dashes for ID and class names | ||
"doctype-html5": true, // Enforce HTML5 doctype | ||
"attr-no-duplication": true, // Disallow duplicate attributes | ||
"title-require": true, // Require title tag in head section | ||
"head-req-title": true, // Require title tag to be non-empty | ||
"tag-req-attr": true, // Require attributes for specific tags | ||
"attr-unsafe-chars": true // Disallow unsafe characters in attribute values | ||
} |
Oops, something went wrong.