Skip to content
Open
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
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ indent_size = 4
indent_style = space
indent_size = 2
max_line_length = 120

# README files (allow longer lines for badges and tables)
[README.md]
indent_style = space
indent_size = 2
max_line_length = 120
trim_trailing_whitespace = false
22 changes: 19 additions & 3 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# This workflow executes several linters on changed files based on languages used in your code base whenever
# you push a code or open a pull request.
# This workflow executes comprehensive linting on changed files using the configured linting infrastructure
# from PR #43. It validates code quality across multiple languages and formats.
#
# Configured linters include:
# - EDITORCONFIG (file formatting consistency)
# - SHELLCHECK (bash/shell script analysis)
# - YAML (YAML syntax and style)
# - JSON (JSON syntax validation)
# - MARKDOWN (Markdown formatting via markdownlint)
# - JSCPD (duplicate code detection)
# - GITLEAKS (secret detection)
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/github/super-linter
name: Lint Code Base
Expand Down Expand Up @@ -31,3 +39,11 @@ jobs:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: "master"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Only enable the linters we need (Super Linter v4 doesn't support mixed true/false)
VALIDATE_EDITORCONFIG: true
VALIDATE_BASH: true
VALIDATE_YAML: true
VALIDATE_JSON: true
VALIDATE_MARKDOWN: true
VALIDATE_JSCPD: true
VALIDATE_GITLEAKS: true
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,10 @@ terraform.tfstate*
.vagrant/
*.swp
*.swo
*~
*~

# Linting artifacts
.jscpd-report/
*.jscpd-report
.super-linter.log
.shellcheckrc.local
14 changes: 14 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"threshold": 3,
"reporters": ["console"],
"ignore": [
"node_modules/**",
"**/*.min.js",
"tests/**",
"docs/dashboard/js/vendor/**"
],
"format": ["javascript", "typescript", "bash"],
"minLines": 10,
"minTokens": 50,
"output": ".jscpd-report"
}
25 changes: 25 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"default": true,
"MD003": {
"style": "atx"
},
"MD007": {
"indent": 2
},
"MD013": {
"line_length": 120,
"headings": false,
"code_blocks": false,
"tables": false
},
"MD024": {
"allow_different_nesting": true
},
"MD033": {
"allowed_elements": ["br", "sub", "sup"]
},
"MD041": false,
"MD046": {
"style": "fenced"
}
}
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Pre-commit hooks for Oracle Instance Creator
# Install: pip install pre-commit && pre-commit install
# Update: pre-commit autoupdate

repos:
# Shell script linting with ShellCheck
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
args: [--format=gcc, --external-sources]
types: [shell]

# YAML linting
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: [-c=.yamllint.yml]
types: [yaml]

# JSON formatting and validation
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: pretty-format-json
args: [--autofix, --indent=2]

# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint
args: [-c, .markdownlint.json]

# EditorConfig validation
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
hooks:
- id: editorconfig-checker
alias: ec

# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-executables-have-shebangs

# Secret detection (GitLeaks)
- repo: https://github.com/zricethezav/gitleaks
rev: v8.17.0
hooks:
- id: gitleaks
42 changes: 42 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ShellCheck configuration for OCI Automation Project
# See: https://www.shellcheck.net/wiki/

# === GLOBAL SUPPRESSIONS ===
# Only suppress issues that are inherent to the project structure

# SC1091: Can't follow non-constant source - we control our sourcing patterns
# SC2086: Quote variables - TEMPORARY suppression until issue #50 resolved (~51 instances)
# SC2155: Declare/assign separately - TEMPORARY suppression until issue #50 resolved (~51 instances)
disable=SC1091,SC2086,SC2155

# === FUTURE WORK (Technical Debt) ===
# The following suppressions should be addressed individually:
#
# SC2086 (Quote variables): ~51 instances - see issue #50
# - Most should be quoted: $var -> "$var"
# - Some intentional word splitting cases need inline suppressions
# disable=SC2086
#
# SC2155 (Declare/assign separately): ~51 instances - see issue #50
# - Split: local var=$(cmd) -> local var; var=$(cmd)
# - Prevents masking command exit codes
# disable=SC2155

# === FILE-SPECIFIC SUPPRESSIONS NEEDED ===
# Global suppressions below should be migrated to file-specific - see issue #51
#
# SC2034: Unused variables (~101 instances)
# - constants.sh: Variables exported for external use
# - Should use: # shellcheck disable=SC2034 at file level
#
# SC2329: Unused functions (~101 instances)
# - test files: Functions called by test frameworks
# - Should use inline suppressions per function

# Source path for external scripts
source-path=SCRIPTDIR

# === TEMPORARY GLOBAL SUPPRESSIONS ===
# TODO: Remove these after migrating to file-specific suppressions (issue #51)
# Suppress SC2034 (unused variables) for constants.sh exports
# Suppress SC2329 (unused functions) in test files called by frameworks
15 changes: 15 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends: default

rules:
line-length:
max: 120
level: warning
truthy:
allowed-values: ["true", "false", "on", "off"]
check-keys: true
trailing-spaces: enable
document-start:
present: true
comments:
min-spaces-from-content: 1
Loading