Releases: integrated-application-development/sonar-delphi
Releases · integrated-application-development/sonar-delphi
1.12.0
Added
- API:
DelphiCheckContext::getUri
method.
Fixed
- Parsing errors on semicolon-delimited generic type parameters in routine implementation headers.
- Incorrect return types for
Length
,High
, andLow
on open/dynamic arrays depending on the compiler version and toolchain. - Name resolution failures on explicit references to default array properties with overloads on ancestor types.
1.11.0
Added
MissingRaise
analysis rule, which flags exception constructions for whichraise
has been omitted.- API:
ProceduralType::directives
method. - API:
ProceduralTypeNode::getDirectives
method. - API:
ProceduralTypeNode::hasDirective
method. - API:
ProceduralTypeHeadingNode::getDirectives
method. - API:
AnonymousMethodNode::getAnonymousMethodHeading
method. - API:
AnonymousMethodNode::getDirectives
method. - API:
AnonymousMethodNode::hasDirective
method. - API:
AnonymousMethodHeadingNode
node type. - API:
DelphiTokenType.ANONYMOUS_METHOD
token type. - API:
DelphiTokenType.ANONYMOUS_METHOD_HEADING
token type.
Fixed
- Parsing errors on
implementation
keywords nested in conditional branches. - Parsing errors on anonymous methods with routine directives (like calling conventions).
IndexOutOfBoundsException
errors around procedural types declared withvarargs
inVariableInitialization
.
1.10.0
Added
FullyQualifiedImport
analysis rule, which flags non-fully qualified imports.- API:
UnitImportNameDeclaration::isAlias
method.
Changed
- Non-trivial
inherited
expressions are excluded inRedundantParentheses
.
Fixed
- False positives around const array literals in
RedundantParentheses
.
1.9.0
Added
- API:
CaseItemStatementNode::getExpressions
method.
Changed
- Improve type inference around unsigned integer literals.
- Improve type inference around array constructors containing integer literals.
- Improve type inference around real expressions.
- Parentheses enclosing a primary expression are considered redundant in
RedundantParentheses
. out
parameters are treated as uninitialized at the start of a routine inVariableInitialization
.
Fixed
- Name resolution errors around alias ancestor types.
- Parsing errors around partial
asm
blocks blocks in conditional branches. - False positives around case items with multiple values in
CaseStatementSize
.
1.8.0
Added
- "Correct to (correct case)" quick fix for
LowercaseKeyword
. - API:
PropertyNameDeclaration::getImplementedTypes
method. - API:
PropertyNode::getDefaultSpecifier
method. - API:
PropertyNode::getImplementsSpecifier
method. - API:
PropertyNode::getIndexSpecifier
method. - API:
PropertyNode::getStoredSpecifier
method. - API:
PropertyDefaultSpecifierNode
node type. - API:
PropertyImplementsSpecifierNode
node type. - API:
PropertyIndexSpecifierNode
node type. - API:
PropertyStoredSpecifierNode
node type.
Changed
- Include the global library path in unit import resolution.
- Improve AST modeling around property specifiers.
- Improve semantic analysis around property specifiers.
- Exclude properties with
implements
specifiers inUnusedProperty
.
Fixed
- Overly permissive parsing rules around
string
andfile
types. - Quick fixes removing comments and compiler directives in
RedundantInherited
. - False positives around
message
handler methods inRedundantInherited
. - False positives when parameter names were mismatched to the inherited method in
RedundantInherited
andInheritedMethodWithNoCode
. - API:
ArrayConstructorNode::getImage
returned an incorrect image containing[
as an element.
1.7.0
Added
RedundantInherited
analysis rule, which flags redundantinherited
statements that can be safely removed.
Changed
- Include "found" and "expected" values for issue messages in
LowercaseKeyword
. - Exclude
J
andK
by default inShortIdentifier
. - Improve compiler directive parsing in cases where the directive name is not followed by whitespace.
Fixed
- The
result
attribute in NUnit test reports was not being treated as case-insensitive. - Scan failures on nested compiler directives.
1.6.0
Added
- "Move to implementation section" quick fix for
ImportSpecificity
. - "Remove unused import" quick fix for
UnusedImport
. - API:
UsesClauseNode::getImports
method. - API:
InterfaceSectionNode::getUsesClause
method. - API:
ImplementationSectionNode::getUsesClause
method. - API:
LabelNameDeclaration
symbol declaration type. - API:
DelphiScope::getLabelDeclarations
method. - API:
LabelDeclarationNode
node type. - API:
LabelStatementNode::getNameReference
method. - API:
LabelStatementNode::getStatement
method. - API:
GotoStatementNode::getNameReference
method.
Changed
- Improve semantic analysis around
label
andgoto
statements. - Improve handling for dereferenced types starting with
E
andI
inPointerName
. - Improve handling for dereferenced types that don't comply with naming conventions in
PointerName
.
Fixed
- File pointer errors when an issue is raised on the first line of a file with a byte order mark.
- Symbol table construction errors for program files omitting the
program
header. - Parsing errors on parenthesised anonymous methods.
- Parsing errors on identifiers named
Label
, which was allowed in Delphi.NET. - Scan failures on invalid paths in dproj files.
- Incorrect ordering of edits in the "Separate grouped parameters" quick fix for
GroupedParameterDeclaration
. - SonarLint registration of rules that don't support execution in a SonarLint context.
1.5.0
Added
- Support for the
winapi
calling convention. - Support for quick fixes.
- "Remove the superflous semicolon" quick fix for
SuperfluousSemicolon
. - "Correct to (correct case)" quick fix for
MixedNames
. - "Remove redundant parentheses" quick fix for
RedundantParentheses
. - "Convert to initialization section" quick fix for
LegacyInitializationSection
. - "Replace Pascal-style result with Result" quick fix for
PascalStyleResult
. - "Replace with TList.Last" quick fix for
IndexLastListElement
. - "Remove empty argument list" quick fix for
EmptyArgumentList
. - "Remove redundant assignment check" quick fix for
AssignedAndFree
. - "Separate grouped parameters" quick fix for
GroupedParameterDeclaration
. - "Remove (n) unused formatting arguments" quick fix for
FormatArgumentCount
. - "Use string value directly" quick fix for
FormatArgumentCount
. - API:
TryStatementNode::getExceptBlock
method. - API:
WhileStatementNode::getGuardExpression
method. - API:
WhileStatementNode::getStatement
method. - API:
DelphiTokenType.WINAPI
token type. - API:
DelphiIssueBuilder
type, which is returned byDelphiCheckContext::newIssue
. - API:
QuickFix
type, which is accepted byDelphiIssueBuilder::withQuickFixes
. - API:
QuickFixEdit
type, which is accepted byQuickFix::addEdits
.
Deprecated
- API:
TryStatementNode::getExpectBlock
method, usegetExceptBlock
instead.
Fixed
- False positive
FormatStringValid
issues on strings containing uppercase format specifiers. - Exception when parsing fully qualified attribute references.
DuplicatedDeclarationException
errors caused by some local scopes being modeled incorrectly.- Name resolution issues around
if
,else
,for
, andwith
constructs when the body contains a single statement.
1.4.0
Added
- Support for multiline string literals within compiler directives.
- Support for the
TEXTBLOCK
directive. - Support for named arguments.
- Support for
assembly
attributes. - API:
CompilerDirectiveParser
can now return a newTextBlockDirective
type. - API:
CheckVerifier::withCompilerVersion
method. - API:
CheckVerifier::withToolchain
method. - API:
DelphiTokenType.ARGUMENT
token type. - API:
DelphiTokenType.ASSEMBLY
token type. - API:
ArgumentNode
node type. - API:
ArgumentListNode::getArgumentNodes
method. - API:
AttributeNode::isAssembly
method.
Changed
NativeInt
andNativeUInt
are now treated as weak aliases in Delphi 12+.- The length of open arrays is now modeled as
NativeInt
in Delphi 12+. - Performance improvements.
Deprecated
- API:
ArgumentListNode::getArguments
method, usegetArgumentNodes
instead.
Fixed
- Type resolution inaccuracies around subtract expressions.
- Name resolution did not occur for the magic
Width
andDecimals
arguments. (See: System.Write) - The wrong inherited method could be found in
InheritedMethodWithNoCode
, causing false negatives. - Exception when scanning UNC paths.
1.3.0
Added
- Support for multiline string literals.
- Support for numeric literals prefixed by ampersands.
- Support for identifiers prefixed by more than 2 ampersands.
- API:
TextLiteralNode::isMultiline
method. - API:
TextLiteralNode::getValue
method, which returns the effective contents of a text literal.
Changed
TextLiteralNode::getImage
now returns the text literal exactly as it appears in source code.TextLiteralNode::getImageWithoutQuotes
now simply calls the newgetValue
method.
Deprecated
TextLiteralNode::getImageWithoutQuotes
, usegetValue
instead.DelphiTokenType.AMPERSAND
, as&
is now lexed directly into numeric literals and identifiers.
Fixed
- Static char arrays weren't accepted for
'%s'
inFormatArgumentType
. - Imaginary tokens could be erroneously matched by the lexer in valid source code.