🥳 🥳 🥳
This is a major release of Diktat, tailored to align with the global changes in the Kotlin ecosystem and the introduction of Kotlin 2.0. Our focus has shifted towards the Kotlin 2.0 compiler plugins, FIR and new IR, encompassing extensive preparatory efforts.
This includes:
- the introduction of a new CLI driver, independent from ktlint;
- transitioning from Maven to Gradle;
- crafting new Gradle and Maven plugins;
- refactoring, including the change of the package name: from
org.cqfn
tocom.saveourtool
; - migrations to latest Kotlin and Ktlint;
- more than 25 fixes, requested by the community.
These initiatives aim to streamline our future development processes, simplifying the creation of new rules, while concurrently enhancing the complexity and precision of existing rules.
Functional changes and bugfixing
- New rule to check if @Preview (Jetpack Compose) functions end with 'Preview' suffix and are also private (Part 1) by @kgevorkyan in #1726
- Extracted
REDUNDANT_SEMICOLON
rule check fromWRONG_NEWLINES
rule by @DrAlexD in #1864 - NPE in NewlinesRule.kt by @diphtongue in #1853
- Provide
fix logic
for @Preview functions by @kgevorkyan in #1728 - Inlined typealias for legacy LintError by @nulls in #1684
- serialVersionUID should be ignored in
CONSTANT_UPPERCASE
by @diphtongue in #1849 - Fixed PreviewAnnotationRule by @nulls in #1740
- Fixed StatelessClassesRule by @nulls in #1741
- Fixed TrailingCommaRule and StringTemplateRuleFixTest by @nulls in #1742
- Fixed CommentsFormatting for else blocks by @nulls in #1743
- Fixed IdentifierNaming by @nulls in #1746
- Fixed KdocMethods by @DrAlexD in #1757
- Fixed IndentationRule by @DrAlexD in #1760
- Fixed KdocComments by @DrAlexD in #1754
- Fixed LineLength by @DrAlexD in #1759
- Fix for a NO_BRACES_IN_CONDITIONALS_AND_LOOPS failure within variable initialization block by @DrAlexD in #1739
- Fixed warning
FUNCTION_BOOLEAN_PREFIX
onoperator fun
by @diphtongue in #1767 - Fixed
KdocComments
for types in generic classes by @DrAlexD in #1832 - Fixed BracesInConditionalsAndLoopsRule and added tests by @DrAlexD in #1750
- Fixed
VARIABLE_NAME_INCORRECT_FORMAT
false positive when a property has a backing field by @diphtongue in #1810 - Fixed bug related to assigning to declared vals inside null-check branches by @DrAlexD in #1851
- Fixed false positive
MISSING_KDOC_ON_FUNCTION
on local function (function inside another function) by @diphtongue in #1848 - Fixed
WRONG_NEWLINES
rule to take into accountmaxCallsInOneLine
by @DrAlexD in #1858 - Fixed
CUSTOM_GETTERS_SETTERS
false positive when a property has a backing field by @diphtongue in #1815 KDOC_WITHOUT_THROWS_TAG
add@throws
annotation when throw inside try-catch by @diphtongue in #1862- Fixed duplicate
@property
generation for parameter with ' in name by @DrAlexD in #1873
New CLI Driver
- Diktat command by @nulls in #1649
- Diktat CLI runner by @nulls in #1653
- Wrap KtLint classes by @nulls in #1648
- Disabled additional rules from KtLint by @nulls in #1643
- Moved Diktat's implementation of KtLint's RuleSetProvider by @nulls in #1654
- Support a full path in DiktatReporter by @nulls in #1798
- Rewrite StreamGobbler by @nulls in #1692
- Return exit code 1 when not all errors are fixed by @nulls in #1868
- Updated arguments for
diktat-cli
by @nulls in #1860 - Fix CLI integration step in README by @Goooler in #1772
- Supported multiple reporters in diktat runner by @nulls in #1803
- Added script for Windows by @nulls in #1859
- Introduced
diktat-runner
by @nulls in #1813 - Fixed diktat-cli by @nulls in #1841
- Make diktat-cli executable by @nulls in #1843
- Use diktat-runner:shadow as variant by @nulls in #1875
New Gradle and Maven plugins
- Fat jar for gradle plugin by @nulls in #1794
- Supported multiple reporters in maven by @nulls in #1824
- Support ANT-like glob patterns by @nulls in #1856
- Fixed maven plugin by @nulls in #1816
Diktat Testing
- Enhance smoke tests by @nulls in #1766
- Enhance tests in diktat by @nulls in #1780
- Fixed smoke tests by @nulls in #1769
- Enhancements for tests by @nulls in #1644
- Moved tests with CLI from GitHub actions to JUnit test by @nulls in #1784
- Remove
diktat-test-framework
by @nulls in #1785
Infra changes
- Migration to Gradle by @nulls in #1625
- Added a placeholder for years by @nulls in #1640
- Diktat API by @nulls in #1655
- Reused 'DiktatProcessor' for inline fix and check by @nulls in #1657
- Migration to Kotlin's imports by @nulls in #1659
- Publish
dependencies
on GitHub by @nulls in #1662, #1663, #1664, #1665 - Removed usage of
GrgitServicePlugin
by @nulls in #1682 - Updating the package name to the new one by @akuleshov7 in #1687
- Diktat rule configs by @nulls in #1686
- Removed close outputStream as separate listener by @nulls in #1688
- Refactored
warn
andwarnAndFix
inWarnings
by @nulls in #1751 - Migration to new package in Maven Central by @nulls in #1744
- Migrated smoke test to diktat cli by @nulls in #1782
- Fix release to maven central by @nulls in #1788
- Supported release to plugins.gradle.org by @nulls in #1789
- Fixed step.id by @nulls in #1790
- Support configuration of reporters in DSL by @nulls in #1808
- Remove dependency to mockito-all by @nulls in #1811
- Fix mergeDiktatReports by @nulls in #1812
- Avoid changing newlines by @nulls in #1830
- Added shadow for diktat-runner by @nulls in #1834
- Support running diktat without configuration by @nulls in #1837
- Refactor
fun isPairPropertyBackingField
usingPSI
by @diphtongue in #1857 - Fixed release.yml by @nulls in #1861
- Rewrote adoc to markdown by @nulls in #1867
- Support virtual path in DiktatProcessor by @nulls in #1874
Dependencies Updates
- Update Kotlin and core dependencies to v1.9.21 by @renovate in #1651, #1669, #1870, #1763.
- Update Ktlint to v1.0.1 by @renovate in #1683, #1729, #1763
- Update all non-major dependencies (except core Kotlin) to v6.18.0 by @renovate in #1652, v8.2 by @renovate in #1704, v8.2.1 by @renovate in #1713, v8.3 by @renovate in #1722, v8.4 by @renovate in #1762, v8.5 by @renovate in #1846
- Update plugin com.gradle.plugin-publish to v1.2.0, com.gradle.enterprise to v3.16.1, talaiot-base to v2 by @renovate in #1660, #1871, #1735
- Update plugin org.gradle.toolchains.foojay-resolver-convention to v0.6.0 by @renovate in #1715
- Update mikepenz/gradle-dependency-submission action to v0.9.1 by @renovate in #1714, #1771
- Update peter-evans/create-pull-request action to v5 by @renovate in #1676
- Update dependency com.google.devtools.ksp:symbol-processing-api to v1.8.20 by @renovate in #1669
- Update dependency io.github.microutils:kotlin-logging to v3 by @renovate in #1681
- Update dependency com.github.johnrengelman.shadow to v8 by @renovate in #1678
- Update dependency com.google.guava:guava to v32, v32.1.3-jre by @renovate in #1677, #1764
- Update actions/checkout action to v4 by @renovate in #1730, #1756
- Update all github actions (major) by @renovate in #1872
- Update actions/setup-java action to v4 by @renovate in #1852
New Contributors
- @DrAlexD made their first contribution in #1739
- @diphtongue made their first contribution in #1767
- @Goooler made their first contribution in #1772
Full Changelog: v1.2.5...v2.0.0