mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-23 05:02:15 -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 #
|
# Globals #
|
||||||
###########
|
###########
|
||||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||||
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
||||||
TEST_FOLDER='.automation/test' # Folder where test are stored
|
TEST_FOLDER='.automation/test' # Folder where test are stored
|
||||||
CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip
|
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
|
((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
|
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||||
|
|
||||||
############################
|
############################
|
||||||
|
@ -39,7 +39,10 @@ CleanTestFiles() {
|
||||||
##################
|
##################
|
||||||
# Find the files #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -70,7 +73,10 @@ CleanTestFiles() {
|
||||||
################################
|
################################
|
||||||
# Its a test, we can delete it #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -96,7 +102,10 @@ CleanTestDockerFiles() {
|
||||||
##################
|
##################
|
||||||
# Find the files #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -127,7 +136,10 @@ CleanTestDockerFiles() {
|
||||||
################################
|
################################
|
||||||
# Its a test, we can delete it #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -153,7 +165,10 @@ CleanSHAFolder() {
|
||||||
##################
|
##################
|
||||||
# Find the files #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -178,7 +193,10 @@ RenameTestFolder() {
|
||||||
#####################
|
#####################
|
||||||
# Rename the folder #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -205,7 +223,10 @@ CleanPowershell() {
|
||||||
##################
|
##################
|
||||||
# Find the files #
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -236,7 +257,10 @@ CleanPowershell() {
|
||||||
################################
|
################################
|
||||||
# Its a test, we can delete it #
|
# 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 #
|
# Load the error code #
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
###########
|
###########
|
||||||
# Globals #
|
# Globals #
|
||||||
###########
|
###########
|
||||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||||
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
||||||
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub
|
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub
|
||||||
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
||||||
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
||||||
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
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
|
((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
|
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
|
|
|
@ -8,21 +8,20 @@
|
||||||
###########
|
###########
|
||||||
# Globals #
|
# Globals #
|
||||||
###########
|
###########
|
||||||
GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running
|
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
|
GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run
|
||||||
SLEEP_SECONDS=20 # Seconds to sleep before next check
|
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_LIMIT=15 # How many times to check the pid before moving on
|
||||||
PID_CHECK=0 # Count of times to check the pid
|
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_LIMIT=15 # How many times to check the process before moving on
|
||||||
PROCESS_CHECK=0 # Count of times to check the process
|
PROCESS_CHECK=0 # Count of times to check the process
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
########################### SUB ROUTINES BELOW #################################
|
########################### SUB ROUTINES BELOW #################################
|
||||||
################################################################################
|
################################################################################
|
||||||
################################################################################
|
################################################################################
|
||||||
#### Function CheckGHEPid ######################################################
|
#### Function CheckGHEPid ######################################################
|
||||||
CheckGHEPid()
|
CheckGHEPid() {
|
||||||
{
|
|
||||||
##################################
|
##################################
|
||||||
# Check to prevent infinite loop #
|
# Check to prevent infinite loop #
|
||||||
##################################
|
##################################
|
||||||
|
@ -75,8 +74,7 @@ CheckGHEPid()
|
||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
#### Function CheckGHEProcess ##################################################
|
#### Function CheckGHEProcess ##################################################
|
||||||
CheckGHEProcess()
|
CheckGHEProcess() {
|
||||||
{
|
|
||||||
##################################
|
##################################
|
||||||
# Check to prevent infinite loop #
|
# Check to prevent infinite loop #
|
||||||
##################################
|
##################################
|
||||||
|
@ -139,8 +137,7 @@ CheckGHEProcess()
|
||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
#### Function RunConfigApply ###################################################
|
#### Function RunConfigApply ###################################################
|
||||||
RunConfigApply()
|
RunConfigApply() {
|
||||||
{
|
|
||||||
##########
|
##########
|
||||||
# Header #
|
# Header #
|
||||||
##########
|
##########
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"host": "{{ ldap_host }}",
|
"host": "{{ ldap_host }}",
|
||||||
"port": {{ ldap_port }},
|
"port": {{ ldap_port }},
|
||||||
"base": [
|
"base": [
|
||||||
"{{ ldap_base_dn }}"
|
"{{ ldap_base_dn }}"
|
||||||
],
|
],
|
||||||
"uid": null,
|
"uid": null,
|
||||||
"bind_dn": "{{ ldap_bind_dn }}",
|
"bind_dn": "{{ ldap_bind_dn }}",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"syslog": {
|
"syslog": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"server": "{{ splunk_host }}:{{ splunk_port }}",
|
"server": "{{ splunk_host }}:{{ splunk_port }}",
|
||||||
"protocol_name": "udp",
|
"protocol_name": "udp",
|
||||||
"tls_enabled": false,
|
"tls_enabled": false,
|
||||||
"cert": null
|
"cert": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns foo
|
(ns foo
|
||||||
(:require
|
(:require
|
||||||
[clojure.string :as str]))
|
[clojure.string :as str]))
|
||||||
|
|
||||||
(butlast [1 2 3])
|
(butlast [1 2 3])
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
||||||
(y)))
|
(y)))
|
||||||
|
|
||||||
(letfn
|
(letfn
|
||||||
[(f [g] (h g))
|
[(f [g] (h g))
|
||||||
(h [i] (f i))])
|
(h [i] (f i))])
|
||||||
|
|
||||||
(defn foo [] 1)
|
(defn foo [] 1)
|
||||||
(inc (foo))
|
(inc (foo))
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
{
|
{
|
||||||
"AWSTemplateFormatVersion": "2010-09-09",
|
"AWSTemplateFormatVersion": "2010-09-09",
|
||||||
"Description": "A sample template",
|
"Description": "A sample template",
|
||||||
"Resources": {
|
"Resources": {
|
||||||
"DNS": {
|
"DNS": {
|
||||||
"Type": "AWS::Route53::HostedZone",
|
"Type": "AWS::Route53::HostedZone",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"HostedZoneConfig": {
|
"HostedZoneConfig": {
|
||||||
"Comment": "Myhostedzoneforexample.com"
|
"Comment": "Myhostedzoneforexample.com"
|
||||||
},
|
},
|
||||||
"Name": "example.com",
|
"Name": "example.com",
|
||||||
"VPCs": [
|
"VPCs": [
|
||||||
{
|
{
|
||||||
"VPCId": "vpc-abcd1234",
|
"VPCId": "vpc-abcd1234",
|
||||||
"VPCRegion": "ap-northeast-1"
|
"VPCRegion": "ap-northeast-1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"VPCId": "vpc-efgh5678",
|
"VPCId": "vpc-efgh5678",
|
||||||
"VPCRegion": "us-west-2"
|
"VPCRegion": "us-west-2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"HostedZoneTags": [
|
"HostedZoneTags": [
|
||||||
{
|
{
|
||||||
"Key": "SampleKey1",
|
"Key": "SampleKey1",
|
||||||
"Value": "SampleValue1"
|
"Value": "SampleValue1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Key": "SampleKey2",
|
"Key": "SampleKey2",
|
||||||
"Value": "SampleValue2"
|
"Value": "SampleValue2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
{
|
{
|
||||||
"Resources" : {
|
"Resources": {
|
||||||
"myDNSRecord" : {
|
"myDNSRecord": {
|
||||||
"Type" : "AWS::Route53::RecordSet",
|
"Type": "AWS::Route53::RecordSet",
|
||||||
"Properties" : {
|
"Properties": {
|
||||||
"HostedZoneId" : "Z8VLZEXAMPLE",
|
"HostedZoneId": "Z8VLZEXAMPLE",
|
||||||
"Name" : "test.example.com",
|
"Name": "test.example.com",
|
||||||
"ResourceRecords" : [
|
"ResourceRecords": [
|
||||||
"192.0.2.99"
|
"192.0.2.99"
|
||||||
],
|
],
|
||||||
"TTL" : 300,
|
"TTL": 300,
|
||||||
"Type" : "A"
|
"Type": "A"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,8 @@ module.exports = (robot) ->
|
||||||
# Drop the hammer #
|
# Drop the hammer #
|
||||||
###################
|
###################
|
||||||
robot.respond /drop the hammer/i, (msg) ->
|
robot.respond /drop the hammer/i, (msg) ->
|
||||||
msg.send "Commencing the hammer dropping..."
|
msg.send "Commencing the hammer dropping..."
|
||||||
msg.send msg.random dropHammer
|
msg.send msg.random dropHammer
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Vape Nation #
|
# Vape Nation #
|
||||||
|
|
|
@ -2,11 +2,11 @@ using System;
|
||||||
|
|
||||||
namespace HelloWorld
|
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
|
## Additional Docs
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Example {
|
class Example {
|
||||||
static void main(String[] args) {
|
static void main(String[] args) {
|
||||||
File file = new File("E:/Example.txt")
|
File file = new File("E:/Example.txt")
|
||||||
println "The file ${file.absolutePath} has ${file.length()} bytes"
|
println "The file ${file.absolutePath} has ${file.length()} bytes"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
<head>
|
||||||
<title>Document</title>
|
<meta charset="UTF-8">
|
||||||
</head>
|
<title>Document</title>
|
||||||
<body>
|
</head>
|
||||||
Good HTML!
|
|
||||||
</body>
|
<body>
|
||||||
|
Good HTML!
|
||||||
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -1,6 +1,6 @@
|
||||||
fun main() {
|
fun main() {
|
||||||
val n = "World"
|
val n = "World"
|
||||||
val v = "Hello, $n!"
|
val v = "Hello, $n!"
|
||||||
|
|
||||||
println(v)
|
println(v)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@ TAP version 13
|
||||||
1..2
|
1..2
|
||||||
not ok 1 - kotlin_bad_1.kt
|
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
|
ok 2 - /tmp/lint/.automation/test/kotlin/kotlint_good_1.kt
|
||||||
|
|
|
@ -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!
|
Indexing text\index{text} is fun!
|
||||||
Indexing text%
|
Indexing text%
|
||||||
\index{text} is fun!
|
\index{text} is fun!
|
||||||
%Indexing text
|
%Indexing text
|
||||||
% \index{text} is fun!
|
% \index{text} is fun!
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
local embracer = {}
|
local embracer = {}
|
||||||
|
|
||||||
local function helper()
|
local function helper()
|
||||||
-- NYI wontfix
|
-- NYI wontfix
|
||||||
end
|
end
|
||||||
|
|
||||||
function embracer.embrace(opt)
|
function embracer.embrace(opt)
|
||||||
opt = opt or "default"
|
opt = opt or "default"
|
||||||
return helper(opt.."?")
|
return helper(opt.."?")
|
||||||
end
|
end
|
||||||
|
|
||||||
return embracer
|
return embracer
|
||||||
|
|
|
@ -11,4 +11,3 @@ function BadFunction {
|
||||||
'Empty Catch Block'
|
'Empty Catch Block'
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,31 +17,31 @@
|
||||||
###########
|
###########
|
||||||
# Globals #
|
# Globals #
|
||||||
###########
|
###########
|
||||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
||||||
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub
|
||||||
DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password 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_USERNAME="${GCR_USERNAME}" # Username to login to GitHub package registry
|
||||||
GCR_TOKEN="${GCR_TOKEN}" # Password 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>
|
REGISTRY="${REGISTRY}" # What registry to upload | <GCR> or <Docker>
|
||||||
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image
|
||||||
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image
|
||||||
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded
|
||||||
MAJOR_TAG='' # Major tag version if we need to update it
|
MAJOR_TAG='' # Major tag version if we need to update it
|
||||||
UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well
|
UPDATE_MAJOR_TAG=0 # Flag to deploy the major tag version as well
|
||||||
GCR_URL='ghcr.io' # URL to Github Container Registry
|
GCR_URL='ghcr.io' # URL to Github Container Registry
|
||||||
DOCKER_IMAGE_REPO='' # Docker tag for the image when created
|
DOCKER_IMAGE_REPO='' # Docker tag for the image when created
|
||||||
GCR_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
|
FOUND_IMAGE=0 # Flag for if the image has already been built
|
||||||
CONTAINER_URL='' # Final URL to upload
|
CONTAINER_URL='' # Final URL to upload
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
# Dynamic build variables to pass to container when built #
|
# 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_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_REVISION=$(git rev-parse --short HEAD) # Current git commit EX> "e89faa7"
|
||||||
BUILD_VERSION='' # Current version of the container being built
|
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
|
((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
|
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
|
if [ ${UPDATE_MAJOR_TAG} -eq 1 ]; then
|
||||||
# Tag the image with the major tag as well
|
# 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 #
|
# Load the error code #
|
||||||
|
@ -515,7 +515,7 @@ FindBuiltImage() {
|
||||||
##############
|
##############
|
||||||
# Local vars #
|
# Local vars #
|
||||||
##############
|
##############
|
||||||
CHECK_IMAGE_REPO='' # Repo to look for
|
CHECK_IMAGE_REPO='' # Repo to look for
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# Set the additional container URL #
|
# Set the additional container URL #
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
###########
|
###########
|
||||||
# Globals #
|
# Globals #
|
||||||
###########
|
###########
|
||||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace
|
||||||
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch
|
||||||
BUILD_DATE="${BUILD_DATE}" # Date the container was built
|
BUILD_DATE="${BUILD_DATE}" # Date the container was built
|
||||||
BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha
|
BUILD_REVISION="${GITHUB_SHA}" # GitHub Sha
|
||||||
BUILD_VERSION="${GITHUB_SHA}" # Version of the container
|
BUILD_VERSION="${GITHUB_SHA}" # Version of the container
|
||||||
ORG_REPO="github/super-linter" # Org/repo
|
ORG_REPO="github/super-linter" # Org/repo
|
||||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||||
ERROR=0 # Error count
|
ERROR=0 # Error count
|
||||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
|
@ -39,8 +39,8 @@ ValidateLabel() {
|
||||||
##############
|
##############
|
||||||
# Grab input #
|
# Grab input #
|
||||||
##############
|
##############
|
||||||
CONTAINER_KEY="$1" # Example: org.opencontainers.image.created
|
CONTAINER_KEY="$1" # Example: org.opencontainers.image.created
|
||||||
CONTAINER_VALUE="$2" # Example: 1985-04-12T23:20:50.52Z
|
CONTAINER_VALUE="$2" # Example: 1985-04-12T23:20:50.52Z
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Get the docker label #
|
# Get the docker label #
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "SUPER-LINTER",
|
"name": "SUPER-LINTER",
|
||||||
"context": "..",
|
"context": "..",
|
||||||
"dockerFile": "..//Dockerfile",
|
"dockerFile": "..//Dockerfile",
|
||||||
"settings": {
|
"settings": {
|
||||||
"terminal.integrated.shell.linux": "/bin/bash"
|
"terminal.integrated.shell.linux": "/bin/bash"
|
||||||
},
|
},
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"github.vscode-pull-request-github",
|
"github.vscode-pull-request-github",
|
||||||
"rogalmic.bash-debug"
|
"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
|
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**
|
**Your impression of priority / how important this request is**
|
||||||
|
|
||||||
- [ ] Critical: Can't use the tool without it.
|
- [ ] Critical: Can't use the tool without it.
|
||||||
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
||||||
- [ ] Important: Will significantly enhance the overall utility of the demo
|
- [ ] Important: Will significantly enhance the overall utility of the demo
|
||||||
- [ ] Nice to have: self-explanatory
|
- [ ] Nice to have: self-explanatory
|
||||||
|
|
||||||
**Business case or other information justifying priority**
|
**Business case or other information justifying priority**
|
||||||
|
|
||||||
**Agreed upon priority**
|
**Agreed upon priority**
|
||||||
- [ ] Critical: Can't use the tool without it.
|
- [ ] Critical: Can't use the tool without it.
|
||||||
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
- [ ] Business Critical: Immediate opportunity to win business with this feature
|
||||||
- [ ] Important: Will significantly enhance the overall utility of the demo
|
- [ ] Important: Will significantly enhance the overall utility of the demo
|
||||||
- [ ] Nice to have: self-explanatory
|
- [ ] 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)
|
**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 -->
|
<!-- markdownlint-restore -->
|
||||||
|
|
2
.github/linters/.cfnlintrc.yml
vendored
2
.github/linters/.cfnlintrc.yml
vendored
|
@ -1,2 +1,2 @@
|
||||||
include_checks:
|
include_checks:
|
||||||
- I
|
- I
|
||||||
|
|
10
.github/linters/.chktexrc
vendored
10
.github/linters/.chktexrc
vendored
|
@ -175,7 +175,7 @@ TabSize = 8
|
||||||
|
|
||||||
CmdLine
|
CmdLine
|
||||||
{
|
{
|
||||||
-v2
|
-v2
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
@ -756,9 +756,9 @@ MathRoman
|
||||||
|
|
||||||
Primitives
|
Primitives
|
||||||
{
|
{
|
||||||
\above \advance \catcode \chardef \closein \closeout \copy \count
|
\above \advance \catcode \chardef \closein \closeout \copy \count
|
||||||
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
||||||
\expandafter \font \hskip \vskip \openout
|
\expandafter \font \hskip \vskip \openout
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
@ -771,7 +771,7 @@ Primitives
|
||||||
|
|
||||||
NoCharNext
|
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)]}
|
{:linters
|
||||||
:refer-all {:exclude [clj-time.jdbc]}}}
|
{:unresolved-symbol
|
||||||
|
{:exclude [(compojure.api.sweet/defroutes)]}
|
||||||
|
:refer-all
|
||||||
|
{:exclude [clj-time.jdbc]}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
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 variable names which should always be accepted, separated by a comma
|
||||||
good-names=i,
|
good-names=i,
|
||||||
j,
|
j,
|
||||||
k,
|
k,
|
||||||
ex,
|
ex,
|
||||||
Run,
|
Run,
|
||||||
_
|
_
|
||||||
|
|
||||||
# Include a hint for the correct naming format with invalid-name
|
# Include a hint for the correct naming format with invalid-name
|
||||||
include-naming-hint=no
|
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}.
|
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||||
# `empty-line` allows space-only lines.
|
# `empty-line` allows space-only lines.
|
||||||
no-space-check=trailing-comma,
|
no-space-check=trailing-comma,dict-separator
|
||||||
dict-separator
|
|
||||||
|
|
||||||
# Allow the body of a class to be on the same line as the declaration if body
|
# Allow the body of a class to be on the same line as the declaration if body
|
||||||
# contains single statement.
|
# contains single statement.
|
||||||
|
@ -490,9 +489,9 @@ analyse-fallback-blocks=no
|
||||||
|
|
||||||
# Deprecated modules which should not be used, separated by a comma
|
# Deprecated modules which should not be used, separated by a comma
|
||||||
deprecated-modules=regsub,
|
deprecated-modules=regsub,
|
||||||
TERMIOS,
|
TERMIOS,
|
||||||
Bastion,
|
Bastion,
|
||||||
rexec
|
rexec
|
||||||
|
|
||||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||||
# not be disabled)
|
# not be disabled)
|
||||||
|
|
|
@ -23,13 +23,13 @@ include:
|
||||||
Examples of unacceptable behavior by participants include:
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
advances
|
advances
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
* Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
* 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
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
## Our Responsibilities
|
## Our Responsibilities
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ TabSize = 8
|
||||||
|
|
||||||
CmdLine
|
CmdLine
|
||||||
{
|
{
|
||||||
-v2
|
-v2
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
@ -756,9 +756,9 @@ MathRoman
|
||||||
|
|
||||||
Primitives
|
Primitives
|
||||||
{
|
{
|
||||||
\above \advance \catcode \chardef \closein \closeout \copy \count
|
\above \advance \catcode \chardef \closein \closeout \copy \count
|
||||||
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
\countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
|
||||||
\expandafter \font \hskip \vskip \openout
|
\expandafter \font \hskip \vskip \openout
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
@ -771,7 +771,7 @@ Primitives
|
||||||
|
|
||||||
NoCharNext
|
NoCharNext
|
||||||
{
|
{
|
||||||
\left:{}$ \right:{}$
|
\left:{}$ \right:{}$
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
|
@ -1,2 +1,7 @@
|
||||||
{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/defroutes)]}
|
{:linters
|
||||||
:refer-all {:exclude [clj-time.jdbc]}}}
|
{:unresolved-symbol
|
||||||
|
{:exclude [(compojure.api.sweet/defroutes)]}
|
||||||
|
:refer-all
|
||||||
|
{:exclude [clj-time.jdbc]}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -324,11 +324,11 @@ function-naming-style=snake_case
|
||||||
|
|
||||||
# Good variable names which should always be accepted, separated by a comma
|
# Good variable names which should always be accepted, separated by a comma
|
||||||
good-names=i,
|
good-names=i,
|
||||||
j,
|
j,
|
||||||
k,
|
k,
|
||||||
ex,
|
ex,
|
||||||
Run,
|
Run,
|
||||||
_
|
_
|
||||||
|
|
||||||
# Include a hint for the correct naming format with invalid-name
|
# Include a hint for the correct naming format with invalid-name
|
||||||
include-naming-hint=no
|
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}.
|
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||||
# `empty-line` allows space-only lines.
|
# `empty-line` allows space-only lines.
|
||||||
no-space-check=trailing-comma,
|
no-space-check=trailing-comma,dict-separator
|
||||||
dict-separator
|
|
||||||
|
|
||||||
# Allow the body of a class to be on the same line as the declaration if body
|
# Allow the body of a class to be on the same line as the declaration if body
|
||||||
# contains single statement.
|
# contains single statement.
|
||||||
|
@ -491,9 +490,9 @@ analyse-fallback-blocks=no
|
||||||
|
|
||||||
# Deprecated modules which should not be used, separated by a comma
|
# Deprecated modules which should not be used, separated by a comma
|
||||||
deprecated-modules=regsub,
|
deprecated-modules=regsub,
|
||||||
TERMIOS,
|
TERMIOS,
|
||||||
Bastion,
|
Bastion,
|
||||||
rexec
|
rexec
|
||||||
|
|
||||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||||
# not be disabled)
|
# not be disabled)
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
parameters:
|
parameters:
|
||||||
level: 5
|
level: 5
|
||||||
|
|
2
dependencies/Gemfile.lock
vendored
2
dependencies/Gemfile.lock
vendored
|
@ -57,4 +57,4 @@ DEPENDENCIES
|
||||||
rubocop-rspec (~> 1.41.0)
|
rubocop-rspec (~> 1.41.0)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.1.4
|
2.1.4
|
||||||
|
|
|
@ -85,7 +85,7 @@ function BuildFileList() {
|
||||||
else
|
else
|
||||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}"
|
WORKSPACE_PATH="${GITHUB_WORKSPACE}"
|
||||||
if [ "${TEST_CASE_RUN}" == "true" ]; then
|
if [ "${TEST_CASE_RUN}" == "true" ]; then
|
||||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################
|
################
|
||||||
|
@ -94,12 +94,12 @@ function BuildFileList() {
|
||||||
debug "----------------------------------------------"
|
debug "----------------------------------------------"
|
||||||
debug "Populating the file list with all the files in the ${WORKSPACE_PATH} workspace"
|
debug "Populating the file list with all the files in the ${WORKSPACE_PATH} workspace"
|
||||||
mapfile -t RAW_FILE_ARRAY < <(find "${WORKSPACE_PATH}" \
|
mapfile -t RAW_FILE_ARRAY < <(find "${WORKSPACE_PATH}" \
|
||||||
-not \( -path '*/\.git' -prune \) \
|
-not \( -path '*/\.git' -prune \) \
|
||||||
-not \( -path '*/\.rbenv' -prune \) \
|
-not \( -path '*/\.rbenv' -prune \) \
|
||||||
-not \( -path '*/\.terragrunt-cache' -prune \) \
|
-not \( -path '*/\.terragrunt-cache' -prune \) \
|
||||||
-not \( -path '*/\.venv' -prune \) \
|
-not \( -path '*/\.venv' -prune \) \
|
||||||
-type f \
|
-type f \
|
||||||
2>&1 | sort)
|
2>&1 | sort)
|
||||||
|
|
||||||
debug "RAW_FILE_ARRAY contents: ${RAW_FILE_ARRAY[*]}"
|
debug "RAW_FILE_ARRAY contents: ${RAW_FILE_ARRAY[*]}"
|
||||||
fi
|
fi
|
||||||
|
@ -401,12 +401,12 @@ function BuildFileList() {
|
||||||
# Get the Powershell files #
|
# Get the Powershell files #
|
||||||
############################
|
############################
|
||||||
elif [ "${FILE_TYPE}" == "ps1" ] ||
|
elif [ "${FILE_TYPE}" == "ps1" ] ||
|
||||||
[ "${FILE_TYPE}" == "psm1" ] ||
|
[ "${FILE_TYPE}" == "psm1" ] ||
|
||||||
[ "${FILE_TYPE}" == "psd1" ] ||
|
[ "${FILE_TYPE}" == "psd1" ] ||
|
||||||
[ "${FILE_TYPE}" == "ps1xml" ] ||
|
[ "${FILE_TYPE}" == "ps1xml" ] ||
|
||||||
[ "${FILE_TYPE}" == "pssc" ] ||
|
[ "${FILE_TYPE}" == "pssc" ] ||
|
||||||
[ "${FILE_TYPE}" == "psrc" ] ||
|
[ "${FILE_TYPE}" == "psrc" ] ||
|
||||||
[ "${FILE_TYPE}" == "cdxml" ]; then
|
[ "${FILE_TYPE}" == "cdxml" ]; then
|
||||||
################################
|
################################
|
||||||
# Append the file to the array #
|
# Append the file to the array #
|
||||||
################################
|
################################
|
||||||
|
@ -703,8 +703,8 @@ function IsValidShellScript() {
|
||||||
[ "${FILE_EXTENSION}" == "bash" ] ||
|
[ "${FILE_EXTENSION}" == "bash" ] ||
|
||||||
[ "${FILE_EXTENSION}" == "dash" ] ||
|
[ "${FILE_EXTENSION}" == "dash" ] ||
|
||||||
[ "${FILE_EXTENSION}" == "ksh" ]; then
|
[ "${FILE_EXTENSION}" == "ksh" ]; then
|
||||||
debug "$FILE is a valid shell script (has a valid extension: ${FILE_EXTENSION})"
|
debug "$FILE is a valid shell script (has a valid extension: ${FILE_EXTENSION})"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${GET_FILE_TYPE_CMD}" == *"POSIX shell script"* ]] ||
|
if [[ "${GET_FILE_TYPE_CMD}" == *"POSIX shell script"* ]] ||
|
||||||
|
@ -712,8 +712,8 @@ function IsValidShellScript() {
|
||||||
[[ ${GET_FILE_TYPE_CMD} == *"dash script"* ]] ||
|
[[ ${GET_FILE_TYPE_CMD} == *"dash script"* ]] ||
|
||||||
[[ ${GET_FILE_TYPE_CMD} == *"ksh script"* ]] ||
|
[[ ${GET_FILE_TYPE_CMD} == *"ksh script"* ]] ||
|
||||||
[[ ${GET_FILE_TYPE_CMD} == *"/usr/bin/env sh script"* ]]; then
|
[[ ${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})"
|
debug "$FILE is a valid shell script (has a valid file type: ${GET_FILE_TYPE_CMD})"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
trace "$FILE is NOT a supported shell script. Skipping"
|
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 #
|
# Log Vars #
|
||||||
# Define these early, so we can use debug logging ASAP if needed #
|
# 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_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_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE)
|
||||||
|
|
||||||
if [[ ${ACTIONS_RUNNER_DEBUG} == true ]]; then LOG_LEVEL="DEBUG"; fi
|
if [[ ${ACTIONS_RUNNER_DEBUG} == true ]]; then LOG_LEVEL="DEBUG"; fi
|
||||||
# Boolean to see trace logs
|
# Boolean to see trace logs
|
||||||
|
@ -56,10 +56,10 @@ source /action/lib/worker.sh # Source the function script(s)
|
||||||
# GLOBALS #
|
# GLOBALS #
|
||||||
###########
|
###########
|
||||||
# Default Vars
|
# 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
|
LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory
|
||||||
GITHUB_API_URL='https://api.github.com' # GitHub API root url
|
GITHUB_API_URL='https://api.github.com' # GitHub API root url
|
||||||
VERSION_FILE='/action/lib/linter-versions.txt' # File to store linter versions
|
VERSION_FILE='/action/lib/linter-versions.txt' # File to store linter versions
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Rules files #
|
# Rules files #
|
||||||
|
@ -219,20 +219,20 @@ LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that w
|
||||||
###################
|
###################
|
||||||
# GitHub ENV Vars #
|
# GitHub ENV Vars #
|
||||||
###################
|
###################
|
||||||
ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory
|
ANSIBLE_DIRECTORY="${ANSIBLE_DIRECTORY}" # Ansible Directory
|
||||||
DEFAULT_BRANCH="${DEFAULT_BRANCH:-master}" # Default Git Branch to use (master by default)
|
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
|
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_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)
|
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_EVENT_PATH="${GITHUB_EVENT_PATH}" # Github Event Path
|
||||||
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
GITHUB_REPOSITORY="${GITHUB_REPOSITORY}" # GitHub Org/Repo passed from system
|
||||||
GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs
|
GITHUB_RUN_ID="${GITHUB_RUN_ID}" # GitHub RUn ID to point to logs
|
||||||
GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit
|
GITHUB_SHA="${GITHUB_SHA}" # GitHub sha from the commit
|
||||||
GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment
|
GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment
|
||||||
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace
|
GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace
|
||||||
MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran
|
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
|
TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases
|
||||||
VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files
|
VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files
|
||||||
|
|
||||||
################
|
################
|
||||||
# Default Vars #
|
# 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 Vars that are called in Subs and need to be ignored #
|
||||||
###############################################################
|
###############################################################
|
||||||
DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors
|
DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors
|
||||||
export DEFAULT_DISABLE_ERRORS # Workaround SC2034
|
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
|
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
|
export ERROR_ON_MISSING_EXEC_BIT
|
||||||
RAW_FILE_ARRAY=() # Array of all files that were changed
|
RAW_FILE_ARRAY=() # Array of all files that were changed
|
||||||
export RAW_FILE_ARRAY # Workaround SC2034
|
export RAW_FILE_ARRAY # Workaround SC2034
|
||||||
TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore
|
TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore
|
||||||
export TEST_CASE_FOLDER # Workaround SC2034
|
export TEST_CASE_FOLDER # Workaround SC2034
|
||||||
WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result.
|
WARNING_ARRAY_TEST=() # Array of warning linters that did not have an expected test result.
|
||||||
export WARNING_ARRAY_TEST # Workaround SC2034
|
export WARNING_ARRAY_TEST # Workaround SC2034
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Format #
|
# Format #
|
||||||
##############
|
##############
|
||||||
OUTPUT_FORMAT="${OUTPUT_FORMAT}" # Output format to be generated. Default none
|
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_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_DETAILS="${OUTPUT_DETAILS:-simpler}" # What level of details. (simpler or detailed). Default simpler
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Array of changed files #
|
# Array of changed files #
|
||||||
|
@ -279,7 +279,7 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
||||||
LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}"
|
LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}"
|
||||||
debug "Checking if linter with name ${LINTER_NAME} for the ${LANGUAGE} language is available..."
|
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
|
# Failed
|
||||||
fatal "Failed to find [${LINTER_NAME}] in system!"
|
fatal "Failed to find [${LINTER_NAME}] in system!"
|
||||||
else
|
else
|
||||||
|
@ -288,8 +288,6 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
########################## FUNCTIONS BELOW #####################################
|
########################## FUNCTIONS BELOW #####################################
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -1189,9 +1187,9 @@ GetGitHubVars
|
||||||
########################################################
|
########################################################
|
||||||
# Initialize variables that depend on GitHub variables #
|
# Initialize variables that depend on GitHub variables #
|
||||||
########################################################
|
########################################################
|
||||||
DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory
|
DEFAULT_ANSIBLE_DIRECTORY="${GITHUB_WORKSPACE}/ansible" # Default Ansible Directory
|
||||||
export DEFAULT_ANSIBLE_DIRECTORY # Workaround SC2034
|
export DEFAULT_ANSIBLE_DIRECTORY # Workaround SC2034
|
||||||
REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder
|
REPORT_OUTPUT_FOLDER="${GITHUB_WORKSPACE}/${OUTPUT_FOLDER}" # Location for the report folder
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Validate the environment #
|
# Validate the environment #
|
||||||
|
@ -1271,7 +1269,6 @@ LINTER_COMMANDS_ARRAY['TYPESCRIPT_STANDARD']="standard --parser @typescript-esli
|
||||||
LINTER_COMMANDS_ARRAY['XML']="xmllint"
|
LINTER_COMMANDS_ARRAY['XML']="xmllint"
|
||||||
LINTER_COMMANDS_ARRAY['YAML']="yamllint -c ${YAML_LINTER_RULES}"
|
LINTER_COMMANDS_ARRAY['YAML']="yamllint -c ${YAML_LINTER_RULES}"
|
||||||
|
|
||||||
|
|
||||||
debug "--- Linter commands ---"
|
debug "--- Linter commands ---"
|
||||||
debug "-----------------------"
|
debug "-----------------------"
|
||||||
for i in "${!LINTER_COMMANDS_ARRAY[@]}"; do
|
for i in "${!LINTER_COMMANDS_ARRAY[@]}"; do
|
||||||
|
@ -1317,8 +1314,8 @@ for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
elif [ "${LANGUAGE}" = "R" ] && [ ! -f "${GITHUB_WORKSPACE}/.lintr" ] && ((${#FILE_ARRAY_R[@]})); then
|
elif [ "${LANGUAGE}" = "R" ] && [ ! -f "${GITHUB_WORKSPACE}/.lintr" ] && ((${#FILE_ARRAY_R[@]})); then
|
||||||
info "No .lintr configuration file found, using defaults."
|
info "No .lintr configuration file found, using defaults."
|
||||||
cp "$R_LINTER_RULES" "$GITHUB_WORKSPACE"
|
cp "$R_LINTER_RULES" "$GITHUB_WORKSPACE"
|
||||||
# Check if there's local configuration for the Raku linter
|
# Check if there's local configuration for the Raku linter
|
||||||
elif [ "${LANGUAGE}" = "RAKU" ] && [ -e "${GITHUB_WORKSPACE}/META6.json" ]; then
|
elif [ "${LANGUAGE}" = "RAKU" ] && [ -e "${GITHUB_WORKSPACE}/META6.json" ]; then
|
||||||
cd "${GITHUB_WORKSPACE}" && zef install --deps-only --/test .
|
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
|
LintAnsibleFiles "${ANSIBLE_LINTER_RULES}" # Passing rules but not needed, dont want to exclude unused var
|
||||||
else
|
else
|
||||||
LINTER_NAME="${LINTER_NAMES_ARRAY["${LANGUAGE}"]}"
|
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."
|
fatal "Cannot find the linter name for ${LANGUAGE} language."
|
||||||
else
|
else
|
||||||
debug "Setting LINTER_NAME to ${LINTER_NAME}..."
|
debug "Setting LINTER_NAME to ${LINTER_NAME}..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LINTER_COMMAND="${LINTER_COMMANDS_ARRAY["${LANGUAGE}"]}"
|
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."
|
fatal "Cannot find the linter command for ${LANGUAGE} language."
|
||||||
else
|
else
|
||||||
debug "Setting LINTER_COMMAND to ${LINTER_COMMAND}..."
|
debug "Setting LINTER_COMMAND to ${LINTER_COMMAND}..."
|
||||||
|
|
|
@ -74,7 +74,7 @@ WriteFile() {
|
||||||
#################################
|
#################################
|
||||||
# Write the data to output file #
|
# Write the data to output file #
|
||||||
#################################
|
#################################
|
||||||
echo "${LINTER}: ${VERSION}" >> "${VERSION_FILE}" 2>&1
|
echo "${LINTER}: ${VERSION}" >>"${VERSION_FILE}" 2>&1
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# Load the error code #
|
# Load the error code #
|
||||||
|
|
|
@ -29,7 +29,7 @@ export NC
|
||||||
# Log Functions
|
# Log Functions
|
||||||
LOG_TEMP=$(mktemp) || echo "Failed to create temporary log file."
|
LOG_TEMP=$(mktemp) || echo "Failed to create temporary log file."
|
||||||
export LOG_TEMP
|
export LOG_TEMP
|
||||||
echo "super-linter Log" > "${LOG_TEMP}"
|
echo "super-linter Log" >"${LOG_TEMP}"
|
||||||
log() {
|
log() {
|
||||||
local TOTERM=${1:-}
|
local TOTERM=${1:-}
|
||||||
local MESSAGE=${2:-}
|
local MESSAGE=${2:-}
|
||||||
|
@ -37,7 +37,7 @@ log() {
|
||||||
if [[ -n ${TOTERM} ]]; then
|
if [[ -n ${TOTERM} ]]; then
|
||||||
tee -a "${LOG_TEMP}" >&2
|
tee -a "${LOG_TEMP}" >&2
|
||||||
else
|
else
|
||||||
cat >> "${LOG_TEMP}" 2>&1
|
cat >>"${LOG_TEMP}" 2>&1
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
cat << EOF
|
|
||||||
|
# editorconfig-checker-disable
|
||||||
|
cat <<EOF
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
/@@#///////@@/(@//@%/(@.@( @@
|
/@@#///////@@/(@//@%/(@.@( @@
|
||||||
|
@ -20,3 +22,4 @@ cat << EOF
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
EOF
|
EOF
|
||||||
|
# editorconfig-checker-enable
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
###########
|
###########
|
||||||
# Globals #
|
# Globals #
|
||||||
###########
|
###########
|
||||||
(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging
|
((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging
|
||||||
ERROR=0 # Error count
|
ERROR=0 # Error count
|
||||||
|
|
||||||
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#### Function LintCodebase #####################################################
|
#### Function LintCodebase #####################################################
|
||||||
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 #
|
# 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)
|
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_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)
|
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})
|
FILE_ARRAY=("$@") # Array of files to validate (Example: ${FILE_ARRAY_JSON})
|
||||||
|
|
||||||
################
|
################
|
||||||
|
@ -98,7 +100,7 @@ function LintCodebase() {
|
||||||
|
|
||||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}"
|
WORKSPACE_PATH="${GITHUB_WORKSPACE}"
|
||||||
if [ "${TEST_CASE_RUN}" == "true" ]; then
|
if [ "${TEST_CASE_RUN}" == "true" ]; then
|
||||||
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
WORKSPACE_PATH="${GITHUB_WORKSPACE}/${TEST_CASE_FOLDER}"
|
||||||
fi
|
fi
|
||||||
debug "Workspace path: ${WORKSPACE_PATH}"
|
debug "Workspace path: ${WORKSPACE_PATH}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue