mirror of
https://github.com/sasjs/lint.git
synced 2026-01-19 10:10:05 +00:00
test: for hasMacroParentheses & noNestedMacros
This commit is contained in:
@@ -22,14 +22,23 @@ const test = (value: string) => {
|
||||
commentStarted
|
||||
))
|
||||
|
||||
if (trimmedStatement.startsWith('%macro ')) {
|
||||
if (trimmedStatement.startsWith('%macro')) {
|
||||
const macroNameDefinition = trimmedStatement
|
||||
.slice(7, trimmedStatement.length)
|
||||
.trim()
|
||||
|
||||
const macroNameDefinitionParts = macroNameDefinition.split('(')
|
||||
const macroName = macroNameDefinitionParts[0]
|
||||
if (macroNameDefinitionParts.length === 1)
|
||||
|
||||
if (!macroName)
|
||||
diagnostics.push({
|
||||
message: 'Macro definition missing name',
|
||||
lineNumber: getLineNumber(statements, index + 1),
|
||||
startColumnNumber: getColNumber(statement, '%macro'),
|
||||
endColumnNumber: statement.length,
|
||||
severity: Severity.Warning
|
||||
})
|
||||
else if (macroNameDefinitionParts.length === 1)
|
||||
diagnostics.push({
|
||||
message,
|
||||
lineNumber: getLineNumber(statements, index + 1),
|
||||
|
||||
Reference in New Issue
Block a user