mirror of
https://github.com/sasjs/lint.git
synced 2025-12-10 17:34:36 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9623828fc8 | ||
| debeff7929 | |||
| c210699954 |
@@ -7,6 +7,7 @@
|
||||
"default": {
|
||||
"noEncodedPasswords": true,
|
||||
"hasDoxygenHeader": true,
|
||||
"defaultHeader": "/**{lineEnding} @file{lineEnding} @brief <Your brief here>{lineEnding} <h4> SAS Macros </h4>{lineEnding}**/",
|
||||
"hasMacroNameInMend": false,
|
||||
"hasMacroParentheses": true,
|
||||
"indentationMultiple": 2,
|
||||
@@ -18,10 +19,7 @@
|
||||
"noTrailingSpaces": true,
|
||||
"lineEndings": "lf",
|
||||
"strictMacroDefinition": true,
|
||||
"ignoreList": [
|
||||
"sajsbuild",
|
||||
"sasjsresults"
|
||||
]
|
||||
"ignoreList": ["sajsbuild", "sasjsresults"]
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
@@ -58,6 +56,14 @@
|
||||
"default": true,
|
||||
"examples": [true, false]
|
||||
},
|
||||
"defaultHeader": {
|
||||
"$id": "#/properties/defaultHeader",
|
||||
"type": "boolean",
|
||||
"title": "defaultHeader",
|
||||
"description": "This sets the default program header - applies when a SAS program does NOT begin with `/**`.",
|
||||
"default": "/**{lineEnding} @file{lineEnding} @brief <Your brief here>{lineEnding} <h4> SAS Macros </h4>{lineEnding}**/",
|
||||
"examples": []
|
||||
},
|
||||
"hasMacroNameInMend": {
|
||||
"$id": "#/properties/hasMacroNameInMend",
|
||||
"type": "boolean",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { LintConfig } from '../types'
|
||||
import { getLintConfig } from '../utils'
|
||||
import { processText } from './shared'
|
||||
|
||||
export const formatText = async (text: string) => {
|
||||
const config = await getLintConfig()
|
||||
export const formatText = async (text: string, configuration?: LintConfig) => {
|
||||
const config = configuration || (await getLintConfig())
|
||||
return processText(text, config)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export const processLine = (config: LintConfig, line: string): string => {
|
||||
config.lineLintRules
|
||||
.filter((r) => !!r.fix)
|
||||
.forEach((rule) => {
|
||||
processedLine = rule.fix!(line)
|
||||
processedLine = rule.fix!(line, config)
|
||||
})
|
||||
|
||||
return processedLine
|
||||
|
||||
Reference in New Issue
Block a user