mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-26 02:31:00 -05:00
Merge pull request #966 from github/editorconfig
Add an .editorconfig configuration file
This commit is contained in:
commit
4b96adeb04
61 changed files with 362 additions and 299 deletions
|
@ -7,11 +7,11 @@
|
|||
###########
|
||||
# Globals #
|
||||
###########
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
||||
TEST_FOLDER='.automation/test' # Folder where test are stored
|
||||
CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip
|
||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
||||
TEST_FOLDER='.automation/test' # Folder where test are stored
|
||||
CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip
|
||||
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||
|
||||
############################
|
||||
|
@ -39,7 +39,10 @@ CleanTestFiles() {
|
|||
##################
|
||||
# Find the files #
|
||||
##################
|
||||
mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*_bad_*" 2>&1)
|
||||
mapfile -t FIND_CMD < <(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
find "${GITHUB_WORKSPACE}" -type f -name "*_bad_*" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -70,7 +73,10 @@ CleanTestFiles() {
|
|||
################################
|
||||
# Its a test, we can delete it #
|
||||
################################
|
||||
REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1)
|
||||
REMOVE_FILE_CMD=$(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
rm -f "$FILE" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -96,7 +102,10 @@ CleanTestDockerFiles() {
|
|||
##################
|
||||
# Find the files #
|
||||
##################
|
||||
mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*Dockerfile" 2>&1)
|
||||
mapfile -t FIND_CMD < <(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
find "${GITHUB_WORKSPACE}" -type f -name "*Dockerfile" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -127,7 +136,10 @@ CleanTestDockerFiles() {
|
|||
################################
|
||||
# Its a test, we can delete it #
|
||||
################################
|
||||
REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1)
|
||||
REMOVE_FILE_CMD=$(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
rm -f "$FILE" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -153,7 +165,10 @@ CleanSHAFolder() {
|
|||
##################
|
||||
# Find the files #
|
||||
##################
|
||||
REMOVE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; sudo rm -rf "${GITHUB_SHA}" 2>&1)
|
||||
REMOVE_CMD=$(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
sudo rm -rf "${GITHUB_SHA}" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -178,7 +193,10 @@ RenameTestFolder() {
|
|||
#####################
|
||||
# Rename the folder #
|
||||
#####################
|
||||
RENAME_FOLDER_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; mv "${TEST_FOLDER}" "${CLEAN_FOLDER}" 2>&1)
|
||||
RENAME_FOLDER_CMD=$(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
mv "${TEST_FOLDER}" "${CLEAN_FOLDER}" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -205,7 +223,10 @@ CleanPowershell() {
|
|||
##################
|
||||
# Find the files #
|
||||
##################
|
||||
mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1)
|
||||
mapfile -t FIND_CMD < <(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -236,7 +257,10 @@ CleanPowershell() {
|
|||
################################
|
||||
# Its a test, we can delete it #
|
||||
################################
|
||||
REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1)
|
||||
REMOVE_FILE_CMD=$(
|
||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
||||
rm -f "$FILE" 2>&1
|
||||
)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
###########
|
||||
# Globals #
|
||||
###########
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
||||
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub
|
||||
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
||||
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
||||
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
||||
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub
|
||||
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
||||
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
||||
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
||||
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||
|
||||
#########################
|
||||
|
|
|
@ -8,21 +8,20 @@
|
|||
###########
|
||||
# Globals #
|
||||
###########
|
||||
GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running
|
||||
GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run
|
||||
SLEEP_SECONDS=20 # Seconds to sleep before next check
|
||||
PID_CHECK_LIMIT=15 # How many times to check the pid before moving on
|
||||
PID_CHECK=0 # Count of times to check the pid
|
||||
PROCESS_CHECK_LIMIT=15 # How many times to check the process before moving on
|
||||
PROCESS_CHECK=0 # Count of times to check the process
|
||||
GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running
|
||||
GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run
|
||||
SLEEP_SECONDS=20 # Seconds to sleep before next check
|
||||
PID_CHECK_LIMIT=15 # How many times to check the pid before moving on
|
||||
PID_CHECK=0 # Count of times to check the pid
|
||||
PROCESS_CHECK_LIMIT=15 # How many times to check the process before moving on
|
||||
PROCESS_CHECK=0 # Count of times to check the process
|
||||
|
||||
################################################################################
|
||||
########################### SUB ROUTINES BELOW #################################
|
||||
################################################################################
|
||||
################################################################################
|
||||
#### Function CheckGHEPid ######################################################
|
||||
CheckGHEPid()
|
||||
{
|
||||
CheckGHEPid() {
|
||||
##################################
|
||||
# Check to prevent infinite loop #
|
||||
##################################
|
||||
|
@ -75,8 +74,7 @@ CheckGHEPid()
|
|||
}
|
||||
################################################################################
|
||||
#### Function CheckGHEProcess ##################################################
|
||||
CheckGHEProcess()
|
||||
{
|
||||
CheckGHEProcess() {
|
||||
##################################
|
||||
# Check to prevent infinite loop #
|
||||
##################################
|
||||
|
@ -139,8 +137,7 @@ CheckGHEProcess()
|
|||
}
|
||||
################################################################################
|
||||
#### Function RunConfigApply ###################################################
|
||||
RunConfigApply()
|
||||
{
|
||||
RunConfigApply() {
|
||||
##########
|
||||
# Header #
|
||||
##########
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"host": "{{ ldap_host }}",
|
||||
"port": {{ ldap_port }},
|
||||
"base": [
|
||||
"{{ ldap_base_dn }}"
|
||||
"{{ ldap_base_dn }}"
|
||||
],
|
||||
"uid": null,
|
||||
"bind_dn": "{{ ldap_bind_dn }}",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"syslog": {
|
||||
"enabled": true,
|
||||
"server": "{{ splunk_host }}:{{ splunk_port }}",
|
||||
"protocol_name": "udp",
|
||||
"tls_enabled": false,
|
||||
"cert": null
|
||||
"enabled": true,
|
||||
"server": "{{ splunk_host }}:{{ splunk_port }}",
|
||||
"protocol_name": "udp",
|
||||
"tls_enabled": false,
|
||||
"cert": null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,4 +50,4 @@
|
|||
"value": "[reference(resourceId('Microsoft.Network/virtualNetworks',variables('Network.Name')), '2019-12-01', 'Full')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(ns foo
|
||||
(:require
|
||||
[clojure.string :as str]))
|
||||
[clojure.string :as str]))
|
||||
|
||||
(butlast [1 2 3])
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
|||
(y)))
|
||||
|
||||
(letfn
|
||||
[(f [g] (h g))
|
||||
(h [i] (f i))])
|
||||
[(f [g] (h g))
|
||||
(h [i] (f i))])
|
||||
|
||||
(defn foo [] 1)
|
||||
(inc (foo))
|
||||
|
@ -31,4 +31,4 @@
|
|||
(ns bar-test (:require [clojure.test :as t]))
|
||||
|
||||
(t/deftest my-tests
|
||||
(t/is (odd? (inc 1))))
|
||||
(t/is (odd? (inc 1))))
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
{
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Description": "A sample template",
|
||||
"Resources": {
|
||||
"DNS": {
|
||||
"Type": "AWS::Route53::HostedZone",
|
||||
"Properties": {
|
||||
"HostedZoneConfig": {
|
||||
"Comment": "Myhostedzoneforexample.com"
|
||||
},
|
||||
"Name": "example.com",
|
||||
"VPCs": [
|
||||
{
|
||||
"VPCId": "vpc-abcd1234",
|
||||
"VPCRegion": "ap-northeast-1"
|
||||
},
|
||||
{
|
||||
"VPCId": "vpc-efgh5678",
|
||||
"VPCRegion": "us-west-2"
|
||||
}
|
||||
],
|
||||
"HostedZoneTags": [
|
||||
{
|
||||
"Key": "SampleKey1",
|
||||
"Value": "SampleValue1"
|
||||
},
|
||||
{
|
||||
"Key": "SampleKey2",
|
||||
"Value": "SampleValue2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Description": "A sample template",
|
||||
"Resources": {
|
||||
"DNS": {
|
||||
"Type": "AWS::Route53::HostedZone",
|
||||
"Properties": {
|
||||
"HostedZoneConfig": {
|
||||
"Comment": "Myhostedzoneforexample.com"
|
||||
},
|
||||
"Name": "example.com",
|
||||
"VPCs": [
|
||||
{
|
||||
"VPCId": "vpc-abcd1234",
|
||||
"VPCRegion": "ap-northeast-1"
|
||||
},
|
||||
{
|
||||
"VPCId": "vpc-efgh5678",
|
||||
"VPCRegion": "us-west-2"
|
||||
}
|
||||
],
|
||||
"HostedZoneTags": [
|
||||
{
|
||||
"Key": "SampleKey1",
|
||||
"Value": "SampleValue1"
|
||||
},
|
||||
{
|
||||
"Key": "SampleKey2",
|
||||
"Value": "SampleValue2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"Resources" : {
|
||||
"myDNSRecord" : {
|
||||
"Type" : "AWS::Route53::RecordSet",
|
||||
"Properties" : {
|
||||
"HostedZoneId" : "Z8VLZEXAMPLE",
|
||||
"Name" : "test.example.com",
|
||||
"ResourceRecords" : [
|
||||
"192.0.2.99"
|
||||
],
|
||||
"TTL" : 300,
|
||||
"Type" : "A"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Resources": {
|
||||
"myDNSRecord": {
|
||||
"Type": "AWS::Route53::RecordSet",
|
||||
"Properties": {
|
||||
"HostedZoneId": "Z8VLZEXAMPLE",
|
||||
"Name": "test.example.com",
|
||||
"ResourceRecords": [
|
||||
"192.0.2.99"
|
||||
],
|
||||
"TTL": 300,
|
||||
"Type": "A"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ module.exports = (robot) ->
|
|||
# Drop the hammer #
|
||||
###################
|
||||
robot.respond /drop the hammer/i, (msg) ->
|
||||
msg.send "Commencing the hammer dropping..."
|
||||
msg.send msg.random dropHammer
|
||||
msg.send "Commencing the hammer dropping..."
|
||||
msg.send msg.random dropHammer
|
||||
|
||||
###############
|
||||
# Vape Nation #
|
||||
|
|
|
@ -2,11 +2,11 @@ using System;
|
|||
|
||||
namespace HelloWorld
|
||||
{
|
||||
class Program
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# EDITORCONFIG_CHECKER Test Cases
|
||||
# EDITORCONFIG Test Cases
|
||||
|
||||
This folder holds the test cases for **EDITORCONFIG_CHECKER**.
|
||||
This folder holds the test cases for **EDITORCONFIG**.
|
||||
|
||||
## Additional Docs
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# Groovy Test Cases
|
||||
This folder holds the test cases for **Groovy**.
|
||||
This folder holds the test cases for **Groovy**.
|
||||
|
||||
## Additional Docs
|
||||
No Additional information is needed for this test case.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class Example {
|
||||
static void main(String[] args) {
|
||||
File file = new File("E:/Example.txt")
|
||||
println "The file ${file.absolutePath} has ${file.length()} bytes"
|
||||
}
|
||||
static void main(String[] args) {
|
||||
File file = new File("E:/Example.txt")
|
||||
println "The file ${file.absolutePath} has ${file.length()} bytes"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
Good HTML!
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Good HTML!
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
fun main() {
|
||||
val n = "World"
|
||||
val v = "Hello, $n!"
|
||||
val n = "World"
|
||||
val v = "Hello, $n!"
|
||||
|
||||
println(v)
|
||||
println(v)
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@ TAP version 13
|
|||
1..2
|
||||
not ok 1 - kotlin_bad_1.kt
|
||||
---
|
||||
message: /tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 1 1 File must end with a newline (\n)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 2 20 Unnecessary semicolon\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 16 Redundant curly braces\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 27 Unnecessary semicolon\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 5 15 Unnecessary semicolon\n
|
||||
message: /tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 1 1 File must end with a newline (\n)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 2 1 Unexpected indentation (4) (should be 2)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 2 20 Unnecessary semicolon\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 1 Unexpected indentation (4) (should be 2)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 16 Redundant curly braces\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 3 27 Unnecessary semicolon\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 5 1 Unexpected indentation (4) (should be 2)\n/tmp/lint/.automation/test/kotlin/kotlin_bad_1.kt 5 15 Unnecessary semicolon\n
|
||||
...
|
||||
ok 2 - /tmp/lint/.automation/test/kotlin/kotlint_good_1.kt
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# LaTeX Test Cases
|
||||
This folder holds the test cases for **LaTeX**.
|
||||
This folder holds the test cases for **LaTeX**.
|
||||
|
||||
## Additional Docs
|
||||
No Additional information is needed for this test case.
|
||||
|
@ -10,4 +10,4 @@ The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should
|
|||
|
||||
## Bad Test Cases
|
||||
The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted.
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
|
|
|
@ -115,7 +115,7 @@ Is this an `example', or is it an `example'.
|
|||
%Indexing text \index{text} is fun!
|
||||
Indexing text\index{text} is fun!
|
||||
Indexing text%
|
||||
\index{text} is fun!
|
||||
\index{text} is fun!
|
||||
%Indexing text
|
||||
% \index{text} is fun!
|
||||
|
||||
|
|
|
@ -10,4 +10,4 @@ The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should
|
|||
|
||||
## Bad Test Cases
|
||||
The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted.
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
local embracer = {}
|
||||
|
||||
local function helper()
|
||||
-- NYI wontfix
|
||||
-- NYI wontfix
|
||||
end
|
||||
|
||||
function embracer.embrace(opt)
|
||||
opt = opt or "default"
|
||||
return helper(opt.."?")
|
||||
opt = opt or "default"
|
||||
return helper(opt.."?")
|
||||
end
|
||||
|
||||
return embracer
|
||||
|
|
|
@ -11,4 +11,3 @@ function BadFunction {
|
|||
'Empty Catch Block'
|
||||
} catch {}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Write-Output "hello world!"
|
||||
Write-Output "hello world!"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
@{
|
||||
'Hello'='World'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Write-Output "hello world!"
|
||||
Write-Output "hello world!"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# R Test Cases
|
||||
This folder holds the test cases for **R**.
|
||||
This folder holds the test cases for **R**.
|
||||
|
||||
## Additional Docs
|
||||
No Additional information is needed for this test case.
|
||||
|
@ -10,4 +10,4 @@ The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should
|
|||
|
||||
## Bad Test Cases
|
||||
The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted.
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
|
|
|
@ -45,4 +45,4 @@ message("single_quotes")
|
|||
# trailing_whitespace
|
||||
y <- 2 + (1:10)
|
||||
|
||||
# trailing_blank_lines
|
||||
# trailing_blank_lines
|
||||
|
|
|
@ -17,31 +17,31 @@
|
|||
###########
|
||||
# Globals #
|
||||
###########
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
||||
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
||||
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub
|
||||
GCR_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry
|
||||
GCR_TOKEN="${GCR_TOKEN}" # Password to login to GitHub package registry
|
||||
REGISTRY="${REGISTRY}" # What registry to upload | <GCR> or <Docker>
|
||||
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
||||
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
||||
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
||||
MAJOR_TAG='' # Major tag version if we need to update it
|
||||
UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well
|
||||
GCR_URL='ghcr.io' # URL to Github Container Registry
|
||||
DOCKER_IMAGE_REPO='' # Docker tag for the image when created
|
||||
GCR_IMAGE_REPO='' # Docker tag for the image when created
|
||||
FOUND_IMAGE=0 # Flag for if the image has already been built
|
||||
CONTAINER_URL='' # Final URL to upload
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
||||
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
||||
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub
|
||||
GCR_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry
|
||||
GCR_TOKEN="${GCR_TOKEN}" # Password to login to GitHub package registry
|
||||
REGISTRY="${REGISTRY}" # What registry to upload | <GCR> or <Docker>
|
||||
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
||||
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
||||
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
||||
MAJOR_TAG='' # Major tag version if we need to update it
|
||||
UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well
|
||||
GCR_URL='ghcr.io' # URL to Github Container Registry
|
||||
DOCKER_IMAGE_REPO='' # Docker tag for the image when created
|
||||
GCR_IMAGE_REPO='' # Docker tag for the image when created
|
||||
FOUND_IMAGE=0 # Flag for if the image has already been built
|
||||
CONTAINER_URL='' # Final URL to upload
|
||||
|
||||
###########################################################
|
||||
# Dynamic build variables to pass to container when built #
|
||||
###########################################################
|
||||
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z"
|
||||
BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7"
|
||||
BUILD_VERSION='' # Current version of the container being built
|
||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
||||
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # Current build date EX> "2017-08-28T09:24:41Z"
|
||||
BUILD_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7"
|
||||
BUILD_VERSION='' # Current version of the container being built
|
||||
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||
|
||||
#########################
|
||||
|
@ -329,7 +329,7 @@ BuildImage() {
|
|||
########################################################
|
||||
if [ ${UPDATE_MAJOR_TAG} -eq 1 ]; then
|
||||
# Tag the image with the major tag as well
|
||||
docker build --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${BUILD_REVISION}" --build-arg "BUILD_VERSION=${MAJOR_TAG}" -t "${CONTAINER_URL}:${MAJOR_TAG}" -f "${DOCKERFILE_PATH}" . 2>&1
|
||||
docker build --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${BUILD_REVISION}" --build-arg "BUILD_VERSION=${MAJOR_TAG}" -t "${CONTAINER_URL}:${MAJOR_TAG}" -f "${DOCKERFILE_PATH}" . 2>&1
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
@ -515,7 +515,7 @@ FindBuiltImage() {
|
|||
##############
|
||||
# Local vars #
|
||||
##############
|
||||
CHECK_IMAGE_REPO='' # Repo to look for
|
||||
CHECK_IMAGE_REPO='' # Repo to look for
|
||||
|
||||
####################################
|
||||
# Set the additional container URL #
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
###########
|
||||
# Globals #
|
||||
###########
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
||||
BUILD_DATE="${BUILD_DATE}" # Date the container was built
|
||||
BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha
|
||||
BUILD_VERSION="${GITHUB_SHA}" # Version of the container
|
||||
ORG_REPO="github/super-linter" # Org/repo
|
||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
||||
ERROR=0 # Error count
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
||||
BUILD_DATE="${BUILD_DATE}" # Date the container was built
|
||||
BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha
|
||||
BUILD_VERSION="${GITHUB_SHA}" # Version of the container
|
||||
ORG_REPO="github/super-linter" # Org/repo
|
||||
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||
ERROR=0 # Error count
|
||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||
|
||||
#########################
|
||||
|
@ -39,8 +39,8 @@ ValidateLabel() {
|
|||
##############
|
||||
# Grab input #
|
||||
##############
|
||||
CONTAINER_KEY="$1" # Example: org.opencontainers.image.created
|
||||
CONTAINER_VALUE="$2" # Example: 1985-04-12T23:20:50.52Z
|
||||
CONTAINER_KEY="$1" # Example: org.opencontainers.image.created
|
||||
CONTAINER_VALUE="$2" # Example: 1985-04-12T23:20:50.52Z
|
||||
|
||||
########################
|
||||
# Get the docker label #
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "SUPER-LINTER",
|
||||
"context": "..",
|
||||
"dockerFile": "..//Dockerfile",
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
"extensions": [
|
||||
"github.vscode-pull-request-github",
|
||||
"rogalmic.bash-debug"
|
||||
]
|
||||
"name": "SUPER-LINTER",
|
||||
"context": "..",
|
||||
"dockerFile": "..//Dockerfile",
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
"extensions": [
|
||||
"github.vscode-pull-request-github",
|
||||
"rogalmic.bash-debug"
|
||||
]
|
||||
}
|
||||
|
|
30
.editorconfig
Normal file
30
.editorconfig
Normal file
|
@ -0,0 +1,30 @@
|
|||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines at the bottom of every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
||||
# Tab indentation
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Make sure every file has a blank line at the end
|
||||
insert_final_newline = true
|
||||
|
||||
# Remove any whitespace characters preceding newline characters
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Give operators breathing room, but not brackets
|
||||
spaces_around_operators = true
|
||||
spaces_around_brackets = false
|
||||
|
||||
# Max line length (not supported by all editors)
|
||||
# Enable this option by un-commenting the following line
|
||||
# max_line_length = 150
|
||||
|
||||
[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1,3 +1,3 @@
|
|||
* text=auto eol=lf
|
||||
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||
|
|
16
.github/ISSUE_TEMPLATE/ENHANCEMENT-REQUEST.md
vendored
16
.github/ISSUE_TEMPLATE/ENHANCEMENT-REQUEST.md
vendored
|
@ -14,18 +14,18 @@ about: Used for requesting enhancements to the GitHub Super-Linter
|
|||
|
||||
**Your impression of priority / how important this request is**
|
||||
|
||||
- [ ] Critical: Can't use the tool without it.
|
||||
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
||||
- [ ] Important: Will significantly enhance the overall utility of the demo
|
||||
- [ ] Nice to have: self-explanatory
|
||||
- [ ] Critical: Can't use the tool without it.
|
||||
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
||||
- [ ] Important: Will significantly enhance the overall utility of the demo
|
||||
- [ ] Nice to have: self-explanatory
|
||||
|
||||
**Business case or other information justifying priority**
|
||||
|
||||
**Agreed upon priority**
|
||||
- [ ] Critical: Can't use the tool without it.
|
||||
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
||||
- [ ] Important: Will significantly enhance the overall utility of the demo
|
||||
- [ ] Nice to have: self-explanatory
|
||||
- [ ] Critical: Can't use the tool without it.
|
||||
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
||||
- [ ] Important: Will significantly enhance the overall utility of the demo
|
||||
- [ ] Nice to have: self-explanatory
|
||||
|
||||
**Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
|
||||
<!-- markdownlint-restore -->
|
||||
|
|
2
.github/linters/.cfnlintrc.yml
vendored
2
.github/linters/.cfnlintrc.yml
vendored
|
@ -1,2 +1,2 @@
|
|||
include_checks:
|
||||
- I
|
||||
- I
|
||||
|
|
10
.github/linters/.chktexrc
vendored
10
.github/linters/.chktexrc
vendored
|
@ -175,7 +175,7 @@ TabSize = 8
|
|||
|
||||
CmdLine
|
||||
{
|
||||
-v2
|
||||
-v2
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
@ -756,9 +756,9 @@ MathRoman
|
|||
|
||||
Primitives
|
||||
{
|
||||
\above \advance \catcode \chardef \closein \closeout \copy \count
|
||||
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
||||
\expandafter \font \hskip \vskip \openout
|
||||
\above \advance \catcode \chardef \closein \closeout \copy \count
|
||||
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
||||
\expandafter \font \hskip \vskip \openout
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
@ -771,7 +771,7 @@ Primitives
|
|||
|
||||
NoCharNext
|
||||
{
|
||||
\left:{}$ \right:{}$
|
||||
\left:{}$ \right:{}$
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
|
9
.github/linters/.clj-kondo/config.edn
vendored
9
.github/linters/.clj-kondo/config.edn
vendored
|
@ -1,2 +1,7 @@
|
|||
{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]}
|
||||
:refer-all {:exclude [clj-time.jdbc]}}}
|
||||
{:linters
|
||||
{:unresolved-symbol
|
||||
{:exclude [(compojure.api.sweet/defroutes)]}
|
||||
:refer-all
|
||||
{:exclude [clj-time.jdbc]}
|
||||
}
|
||||
}
|
||||
|
|
2
.github/linters/.htmlhintrc
vendored
2
.github/linters/.htmlhintrc
vendored
|
@ -22,4 +22,4 @@
|
|||
"href-abs-or-rel": false,
|
||||
"attr-unsafe-chars": true,
|
||||
"head-script-disabled": true
|
||||
}
|
||||
}
|
||||
|
|
2
.github/linters/.perlcriticrc
vendored
2
.github/linters/.perlcriticrc
vendored
|
@ -1,2 +1,2 @@
|
|||
severity = 1
|
||||
verbose = %f:%l:%c [%s %p] %m near '%r'\n
|
||||
verbose = %f:%l:%c [%s %p] %m near '%r'\n
|
||||
|
|
19
.github/linters/.python-lint
vendored
19
.github/linters/.python-lint
vendored
|
@ -323,11 +323,11 @@ function-naming-style=snake_case
|
|||
|
||||
# Good variable names which should always be accepted, separated by a comma
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name
|
||||
include-naming-hint=no
|
||||
|
@ -418,8 +418,7 @@ max-module-lines=1000
|
|||
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||
# `empty-line` allows space-only lines.
|
||||
no-space-check=trailing-comma,
|
||||
dict-separator
|
||||
no-space-check=trailing-comma,dict-separator
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
|
@ -490,9 +489,9 @@ analyse-fallback-blocks=no
|
|||
|
||||
# Deprecated modules which should not be used, separated by a comma
|
||||
deprecated-modules=regsub,
|
||||
TERMIOS,
|
||||
Bastion,
|
||||
rexec
|
||||
TERMIOS,
|
||||
Bastion,
|
||||
rexec
|
||||
|
||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
|
|
6
.github/release-drafter.yml
vendored
6
.github/release-drafter.yml
vendored
|
@ -3,9 +3,9 @@ tag-template: 'v$RESOLVED_VERSION'
|
|||
template: |
|
||||
# Changelog
|
||||
$CHANGES
|
||||
|
||||
See details of [all code changes](https://github.com/github/super-linter/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
|
||||
|
||||
|
||||
See details of [all code changes](https://github.com/github/super-linter/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
|
||||
|
||||
categories:
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
|
|
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
|
@ -13,4 +13,4 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,13 +23,13 @@ include:
|
|||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ TabSize = 8
|
|||
|
||||
CmdLine
|
||||
{
|
||||
-v2
|
||||
-v2
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
@ -756,9 +756,9 @@ MathRoman
|
|||
|
||||
Primitives
|
||||
{
|
||||
\above \advance \catcode \chardef \closein \closeout \copy \count
|
||||
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
||||
\expandafter \font \hskip \vskip \openout
|
||||
\above \advance \catcode \chardef \closein \closeout \copy \count
|
||||
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
||||
\expandafter \font \hskip \vskip \openout
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
@ -771,7 +771,7 @@ Primitives
|
|||
|
||||
NoCharNext
|
||||
{
|
||||
\left:{}$ \right:{}$
|
||||
\left:{}$ \right:{}$
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]}
|
||||
:refer-all {:exclude [clj-time.jdbc]}}}
|
||||
{:linters
|
||||
{:unresolved-symbol
|
||||
{:exclude [(compojure.api.sweet/defroutes)]}
|
||||
:refer-all
|
||||
{:exclude [clj-time.jdbc]}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
"href-abs-or-rel": false,
|
||||
"attr-unsafe-chars": true,
|
||||
"head-script-disabled": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
severity = 1
|
||||
verbose = %f:%l:%c [%s %p] %m near '%r'\n
|
||||
verbose = %f:%l:%c [%s %p] %m near '%r'\n
|
||||
|
|
|
@ -324,11 +324,11 @@ function-naming-style=snake_case
|
|||
|
||||
# Good variable names which should always be accepted, separated by a comma
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name
|
||||
include-naming-hint=no
|
||||
|
@ -419,8 +419,7 @@ max-module-lines=1000
|
|||
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||
# `empty-line` allows space-only lines.
|
||||
no-space-check=trailing-comma,
|
||||
dict-separator
|
||||
no-space-check=trailing-comma,dict-separator
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
|
@ -491,9 +490,9 @@ analyse-fallback-blocks=no
|
|||
|
||||
# Deprecated modules which should not be used, separated by a comma
|
||||
deprecated-modules=regsub,
|
||||
TERMIOS,
|
||||
Bastion,
|
||||
rexec
|
||||
TERMIOS,
|
||||
Bastion,
|
||||
rexec
|
||||
|
||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
parameters:
|
||||
level: 5
|
||||
level: 5
|
||||
|
|
|
@ -5,5 +5,5 @@ runs:
|
|||
using: 'docker'
|
||||
image: 'docker://ghcr.io/github/super-linter:v3'
|
||||
branding:
|
||||
icon: 'check-square'
|
||||
icon: 'check-square'
|
||||
color: 'white'
|
||||
|
|
2
dependencies/Gemfile.lock
vendored
2
dependencies/Gemfile.lock
vendored
|
@ -57,4 +57,4 @@ DEPENDENCIES
|
|||
rubocop-rspec (~> 1.41.0)
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
2.1.4
|
||||
|
|
|
@ -6,7 +6,7 @@ You can tell Super-Linter where your rules files are located with the ``LINTER_R
|
|||
|
||||
## Here is an example
|
||||
|
||||
Below is an example of how to configure the ``env`` section of Super-Linter's ``linter.yml`` to lint JavaScript and CSS code using ``eslint`` and ``stylelint`` with your own ``.eslintrc.json`` and ``.stylelintrc.json`` rules files that are located in the root directory of your repository.
|
||||
Below is an example of how to configure the ``env`` section of Super-Linter's ``linter.yml`` to lint JavaScript and CSS code using ``eslint`` and ``stylelint`` with your own ``.eslintrc.json`` and ``.stylelintrc.json`` rules files that are located in the root directory of your repository.
|
||||
|
||||
``` yaml
|
||||
env:
|
||||
|
|
|
@ -85,7 +85,7 @@ function BuildFileList() {
|
|||
else
|
||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}"
|
||||
if [ "${TEST_CASE_RUN}" == "true" ]; then
|
||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
||||
fi
|
||||
|
||||
################
|
||||
|
@ -94,12 +94,12 @@ function BuildFileList() {
|
|||
debug "----------------------------------------------"
|
||||
debug "Populating the file list with all the files in the ${WORKSPACE_PATH} workspace"
|
||||
mapfile -t RAW_FILE_ARRAY < <(find "${WORKSPACE_PATH}" \
|
||||
-not \( -path '*/\.git' -prune \) \
|
||||
-not \( -path '*/\.rbenv' -prune \) \
|
||||
-not \( -path '*/\.terragrunt-cache' -prune \) \
|
||||
-not \( -path '*/\.venv' -prune \) \
|
||||
-type f \
|
||||
2>&1 | sort)
|
||||
-not \( -path '*/\.git' -prune \) \
|
||||
-not \( -path '*/\.rbenv' -prune \) \
|
||||
-not \( -path '*/\.terragrunt-cache' -prune \) \
|
||||
-not \( -path '*/\.venv' -prune \) \
|
||||
-type f \
|
||||
2>&1 | sort)
|
||||
|
||||
debug "RAW_FILE_ARRAY contents: ${RAW_FILE_ARRAY[*]}"
|
||||
fi
|
||||
|
@ -401,12 +401,12 @@ function BuildFileList() {
|
|||
# Get the Powershell files #
|
||||
############################
|
||||
elif [ "${FILE_TYPE}" == "ps1" ] ||
|
||||
[ "${FILE_TYPE}" == "psm1" ] ||
|
||||
[ "${FILE_TYPE}" == "psd1" ] ||
|
||||
[ "${FILE_TYPE}" == "ps1xml" ] ||
|
||||
[ "${FILE_TYPE}" == "pssc" ] ||
|
||||
[ "${FILE_TYPE}" == "psrc" ] ||
|
||||
[ "${FILE_TYPE}" == "cdxml" ]; then
|
||||
[ "${FILE_TYPE}" == "psm1" ] ||
|
||||
[ "${FILE_TYPE}" == "psd1" ] ||
|
||||
[ "${FILE_TYPE}" == "ps1xml" ] ||
|
||||
[ "${FILE_TYPE}" == "pssc" ] ||
|
||||
[ "${FILE_TYPE}" == "psrc" ] ||
|
||||
[ "${FILE_TYPE}" == "cdxml" ]; then
|
||||
################################
|
||||
# Append the file to the array #
|
||||
################################
|
||||
|
@ -703,8 +703,8 @@ function IsValidShellScript() {
|
|||
[ "${FILE_EXTENSION}" == "bash" ] ||
|
||||
[ "${FILE_EXTENSION}" == "dash" ] ||
|
||||
[ "${FILE_EXTENSION}" == "ksh" ]; then
|
||||
debug "$FILE is a valid shell script (has a valid extension: ${FILE_EXTENSION})"
|
||||
return 0
|
||||
debug "$FILE is a valid shell script (has a valid extension: ${FILE_EXTENSION})"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "${GET_FILE_TYPE_CMD}" == *"POSIX shell script"* ]] ||
|
||||
|
@ -712,8 +712,8 @@ function IsValidShellScript() {
|
|||
[[ ${GET_FILE_TYPE_CMD} == *"dash script"* ]] ||
|
||||
[[ ${GET_FILE_TYPE_CMD} == *"ksh script"* ]] ||
|
||||
[[ ${GET_FILE_TYPE_CMD} == *"/usr/bin/env sh script"* ]]; then
|
||||
debug "$FILE is a valid shell script (has a valid file type: ${GET_FILE_TYPE_CMD})"
|
||||
return 0
|
||||
debug "$FILE is a valid shell script (has a valid file type: ${GET_FILE_TYPE_CMD})"
|
||||
return 0
|
||||
fi
|
||||
|
||||
trace "$FILE is NOT a supported shell script. Skipping"
|
||||
|
|
|
@ -17,8 +17,8 @@ ACTIONS_RUNNER_DEBUG="${ACTIONS_RUNNER_DEBUG:-false}" # Boolean to see even more
|
|||
# Log Vars #
|
||||
# Define these early, so we can use debug logging ASAP if needed #
|
||||
##################################################################
|
||||
LOG_FILE="${LOG_FILE:-super-linter.log}" # Default log file name (located in GITHUB_WORKSPACE folder)
|
||||
LOG_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE)
|
||||
LOG_FILE="${LOG_FILE:-super-linter.log}" # Default log file name (located in GITHUB_WORKSPACE folder)
|
||||
LOG_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE)
|
||||
|
||||
if [[ ${ACTIONS_RUNNER_DEBUG} == true ]]; then LOG_LEVEL="DEBUG"; fi
|
||||
# Boolean to see trace logs
|
||||
|
@ -56,10 +56,10 @@ source /action/lib/worker.sh # Source the function script(s)
|
|||
# GLOBALS #
|
||||
###########
|
||||
# Default Vars
|
||||
DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location
|
||||
DEFAULT_RULES_LOCATION='/action/lib/.automation' # Default rules files location
|
||||
LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory
|
||||
GITHUB_API_URL='https://api.github.com' # GitHub API root url
|
||||
VERSION_FILE='/action/lib/linter-versions.txt' # File to store linter versions
|
||||
GITHUB_API_URL='https://api.github.com' # GitHub API root url
|
||||
VERSION_FILE='/action/lib/linter-versions.txt' # File to store linter versions
|
||||
|
||||
###############
|
||||
# Rules files #
|
||||
|
@ -219,20 +219,20 @@ LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that w
|
|||
###################
|
||||
# GitHub ENV Vars #
|
||||
###################
|
||||
ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory
|
||||
DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default)
|
||||
DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors
|
||||
FILTER_REGEX_INCLUDE="${FILTER_REGEX_INCLUDE}" # RegExp defining which files will be processed by linters (all by default)
|
||||
FILTER_REGEX_EXCLUDE="${FILTER_REGEX_EXCLUDE}" # RegExp defining which files will be excluded from linting (none by default)
|
||||
GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path
|
||||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
||||
GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs
|
||||
GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit
|
||||
GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace
|
||||
MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran
|
||||
TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases
|
||||
VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files
|
||||
ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory
|
||||
DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default)
|
||||
DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors
|
||||
FILTER_REGEX_INCLUDE="${FILTER_REGEX_INCLUDE}" # RegExp defining which files will be processed by linters (all by default)
|
||||
FILTER_REGEX_EXCLUDE="${FILTER_REGEX_EXCLUDE}" # RegExp defining which files will be excluded from linting (none by default)
|
||||
GITHUB_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path
|
||||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
||||
GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs
|
||||
GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit
|
||||
GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment
|
||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace
|
||||
MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran
|
||||
TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases
|
||||
VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files
|
||||
|
||||
################
|
||||
# Default Vars #
|
||||
|
@ -245,23 +245,23 @@ DEFAULT_TEST_CASE_RUN='false' # Flag to tell code to run o
|
|||
###############################################################
|
||||
# Default Vars that are called in Subs and need to be ignored #
|
||||
###############################################################
|
||||
DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors
|
||||
export DEFAULT_DISABLE_ERRORS # Workaround SC2034
|
||||
DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors
|
||||
export DEFAULT_DISABLE_ERRORS # Workaround SC2034
|
||||
ERROR_ON_MISSING_EXEC_BIT="${ERROR_ON_MISSING_EXEC_BIT:-false}" # Default to report a warning if a shell script doesn't have the executable bit set to 1
|
||||
export ERROR_ON_MISSING_EXEC_BIT
|
||||
RAW_FILE_ARRAY=() # Array of all files that were changed
|
||||
export RAW_FILE_ARRAY # Workaround SC2034
|
||||
TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore
|
||||
export TEST_CASE_FOLDER # Workaround SC2034
|
||||
WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result.
|
||||
export WARNING_ARRAY_TEST # Workaround SC2034
|
||||
RAW_FILE_ARRAY=() # Array of all files that were changed
|
||||
export RAW_FILE_ARRAY # Workaround SC2034
|
||||
TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore
|
||||
export TEST_CASE_FOLDER # Workaround SC2034
|
||||
WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result.
|
||||
export WARNING_ARRAY_TEST # Workaround SC2034
|
||||
|
||||
##############
|
||||
# Format #
|
||||
##############
|
||||
OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none
|
||||
OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report
|
||||
OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler
|
||||
OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none
|
||||
OUTPUT_FOLDER="${OUTPUT_FOLDER:-super-linter.report}" # Folder where the reports are generated. Default super-linter.report
|
||||
OUTPUT_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler
|
||||
|
||||
##########################
|
||||
# Array of changed files #
|
||||
|
@ -279,7 +279,7 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
|||
LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}"
|
||||
debug "Checking if linter with name ${LINTER_NAME} for the ${LANGUAGE} language is available..."
|
||||
|
||||
if ! command -v "${LINTER_NAME}" 1&>/dev/null 2>&1; then
|
||||
if ! command -v "${LINTER_NAME}" 1 &>/dev/null 2>&1; then
|
||||
# Failed
|
||||
fatal "Failed to find [${LINTER_NAME}] in system!"
|
||||
else
|
||||
|
@ -288,8 +288,6 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
|||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
########################## FUNCTIONS BELOW #####################################
|
||||
################################################################################
|
||||
|
@ -1189,9 +1187,9 @@ GetGitHubVars
|
|||
########################################################
|
||||
# Initialize variables that depend on GitHub variables #
|
||||
########################################################
|
||||
DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory
|
||||
export DEFAULT_ANSIBLE_DIRECTORY # Workaround SC2034
|
||||
REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder
|
||||
DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory
|
||||
export DEFAULT_ANSIBLE_DIRECTORY # Workaround SC2034
|
||||
REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder
|
||||
|
||||
############################
|
||||
# Validate the environment #
|
||||
|
@ -1271,7 +1269,6 @@ LINTER_COMMANDS_ARRAY['TYPESCRIPT_STANDARD']="standard --parser @typescript-esli
|
|||
LINTER_COMMANDS_ARRAY['XML']="xmllint"
|
||||
LINTER_COMMANDS_ARRAY['YAML']="yamllint -c ${YAML_LINTER_RULES}"
|
||||
|
||||
|
||||
debug "--- Linter commands ---"
|
||||
debug "-----------------------"
|
||||
for i in "${!LINTER_COMMANDS_ARRAY[@]}"; do
|
||||
|
@ -1317,8 +1314,8 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
|||
continue
|
||||
fi
|
||||
elif [ "${LANGUAGE}" = "R" ] && [ ! -f "${GITHUB_WORKSPACE}/.lintr" ] && ((${#FILE_ARRAY_R[@]})); then
|
||||
info "No .lintr configuration file found, using defaults."
|
||||
cp "$R_LINTER_RULES" "$GITHUB_WORKSPACE"
|
||||
info "No .lintr configuration file found, using defaults."
|
||||
cp "$R_LINTER_RULES" "$GITHUB_WORKSPACE"
|
||||
# Check if there's local configuration for the Raku linter
|
||||
elif [ "${LANGUAGE}" = "RAKU" ] && [ -e "${GITHUB_WORKSPACE}/META6.json" ]; then
|
||||
cd "${GITHUB_WORKSPACE}" && zef install --deps-only --/test .
|
||||
|
@ -1331,14 +1328,14 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
|||
LintAnsibleFiles "${ANSIBLE_LINTER_RULES}" # Passing rules but not needed, dont want to exclude unused var
|
||||
else
|
||||
LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}"
|
||||
if [ -z "${LINTER_NAME}" ];then
|
||||
if [ -z "${LINTER_NAME}" ]; then
|
||||
fatal "Cannot find the linter name for ${LANGUAGE} language."
|
||||
else
|
||||
debug "Setting LINTER_NAME to ${LINTER_NAME}..."
|
||||
fi
|
||||
|
||||
LINTER_COMMAND="${LINTER_COMMANDS_ARRAY["${LANGUAGE}"]}"
|
||||
if [ -z "${LINTER_COMMAND}" ];then
|
||||
if [ -z "${LINTER_COMMAND}" ]; then
|
||||
fatal "Cannot find the linter command for ${LANGUAGE} language."
|
||||
else
|
||||
debug "Setting LINTER_COMMAND to ${LINTER_COMMAND}..."
|
||||
|
|
|
@ -74,7 +74,7 @@ WriteFile() {
|
|||
#################################
|
||||
# Write the data to output file #
|
||||
#################################
|
||||
echo "${LINTER}: ${VERSION}" >> "${VERSION_FILE}" 2>&1
|
||||
echo "${LINTER}: ${VERSION}" >>"${VERSION_FILE}" 2>&1
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
|
|
|
@ -29,7 +29,7 @@ export NC
|
|||
# Log Functions
|
||||
LOG_TEMP=$(mktemp) || echo "Failed to create temporary log file."
|
||||
export LOG_TEMP
|
||||
echo "super-linter Log" > "${LOG_TEMP}"
|
||||
echo "super-linter Log" >"${LOG_TEMP}"
|
||||
log() {
|
||||
local TOTERM=${1:-}
|
||||
local MESSAGE=${2:-}
|
||||
|
@ -37,7 +37,7 @@ log() {
|
|||
if [[ -n ${TOTERM} ]]; then
|
||||
tee -a "${LOG_TEMP}" >&2
|
||||
else
|
||||
cat >> "${LOG_TEMP}" 2>&1
|
||||
cat >>"${LOG_TEMP}" 2>&1
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
cat << EOF
|
||||
|
||||
# editorconfig-checker-disable
|
||||
cat <<EOF
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
/@@#///////@@/(@//@%/(@.@( @@
|
||||
|
@ -20,3 +22,4 @@ cat << EOF
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
EOF
|
||||
# editorconfig-checker-enable
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
###########
|
||||
# Globals #
|
||||
###########
|
||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
||||
ERROR=0 # Error count
|
||||
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||
ERROR=0 # Error count
|
||||
|
||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
################################################################################
|
||||
#### Function LintCodebase #####################################################
|
||||
function LintCodebase() {
|
||||
# Call comes thorugh as:
|
||||
# LintCodebase "${LANGUAGE}" "${LINTER_NAME}" "${LINTER_COMMAND}" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${TEST_CASE_RUN}" "${!LANGUAGE_FILE_ARRAY}"
|
||||
####################
|
||||
# Pull in the vars #
|
||||
####################
|
||||
|
@ -18,7 +20,7 @@ function LintCodebase() {
|
|||
LINTER_COMMAND="${1}" && shift # Pull the variable and remove from array path (Example: jsonlint -c ConfigFile /path/to/file)
|
||||
FILTER_REGEX_INCLUDE="${1}" && shift # Pull the variable and remove from array path (Example: */src/*,*/test/*)
|
||||
FILTER_REGEX_EXCLUDE="${1}" && shift # Pull the variable and remove from array path (Example: */examples/*,*/test/*.test)
|
||||
TEST_CASE_RUN="${1}" && shift
|
||||
TEST_CASE_RUN="${1}" && shift # Flag for if running in test cases
|
||||
FILE_ARRAY=("$@") # Array of files to validate (Example: ${FILE_ARRAY_JSON})
|
||||
|
||||
################
|
||||
|
@ -98,7 +100,7 @@ function LintCodebase() {
|
|||
|
||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}"
|
||||
if [ "${TEST_CASE_RUN}" == "true" ]; then
|
||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
||||
fi
|
||||
debug "Workspace path: ${WORKSPACE_PATH}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue