Skip to content

Release v1.0.0-beta.1 - #2115

Merged
igorwojda merged 181 commits into
mainfrom
release/v1.0.0-beta.1
Nov 4, 2026
Merged

igorwojda merged 181 commits into
mainfrom
release/v1.0.0-beta.1

Conversation

@igorwojda

Copy link
Copy Markdown
Contributor

Release v1.0.0-beta.1 from develop (181 commits since v0.18.1).

Before After
konsist.version 0.18.1 1.0.0-beta.1
  • Draft GitHub release v1.0.0-beta.1 exists (target main, pre-release).
  • No deprecated API to remove.
  • After merge, the Release workflow publishes to Maven Central and publishes the draft release as a GitHub pre-release (not marked latest).

Merge pull request #1923 from LemonAppDev/release/v0.18.1
* Clean Up release docs and scripts

* Clean Up release docs and scripts
* Normalize moduleName separators to / on all OSes

* Add nested module moduleName test to declaration tester
…ows (#1927)

* Use clickable file:/// links and / separators in output paths on Windows

Error output hyperlinks now use file:/// prefix and / separators on all OSes, so
they are clickable in IntelliJ console on Windows. KoScope toString/print and
KotlinFileParser/PathProvider error messages also use / separators.

* Expect / separators in path tester KoScope toString test
* Run lib test and integrationTest on Windows in CI

* Make lib tests pass on Windows

- Compare paths using OS separator in path/location tests
- Build expected file:/// links with HyperlinkUtil in assertEmpty tests
- Read only .kt files in SnippetTest (non-.kt build files can be locked on Windows)
- Mock git paths with OS separator in GitProjectRootDirResolverTest

* Use invariant separators for snippet paths in SnippetTest
* Add nested module scope tests to declaration tester

* Add featurePaymentMainSourceSetDirectory to PathProvider

* Use OS separator in expected nested module paths
…1935)

Scope creation from directories and files now accepts both separators on all OSes.
KoScope toString/print and parser/root-path error messages use OS separators,
matching path, projectPath, location and projectRootPath. KDoc documents separators.
List path/module filters and scope creator module params accept / and \ on all OSes.
locationWithText uses OS separators.
* Pass unix separator paths unconverted in path tester tests

Inputs to scopeFromFile(s)/scopeFromDirectory(ies) no longer go through
toOsSeparator(), so the Windows CI job exercises the forward-slash paths
users actually write. Expected outputs still use OS separators.
Add windows separator tests for scopeFromFiles and scopeFromDirectories.

* Make PathProvider project directory paths const
…1940)

Module name is root only for files directly in <root>/src/, matching
scopeFromModule("root"). Result no longer depends on checkout folder name.
Files starting with a BOM lost their package, so package-based rules silently skipped them.
…ule names (#1941)

* Support Gradle-style paths in module scopes and throw for invalid module names

scopeFromModule(":feature:auth") and "feature:auth" returned an empty scope, so
rules on it passed without checking anything. Module names now accept Gradle
project paths, "/" and "\" separators. Non-existent modules, modules without
Kotlin files, blank names and empty module lists throw IllegalArgumentException.

* Expect exception for nested module parent directory in declaration tester

KoScopeFromNestedModuleTest expected an empty scope for scopeFromModule("feature"),
which now throws. Also cover Gradle project path for nested modules.
Five toHyperlink tests built the expected value with toExpectedFileUrl, which
duplicated the code under test, so they could not catch regressions.
…dule (#1946)

resideInModule and withModule normalize module names the same way
scopeFromModule does since #1941. Cover leading and trailing slashes
and backslashes to prevent regressions.
* Verify CI: Declaration Tester Project Ubuntu

* Fix order-dependent KoClassDeclarationForKoTestClassProviderTest on Ubuntu

The parameterized test picked .first() class from app production scope.
File order differs per filesystem, so on Ubuntu a class without tests
was selected. Select AppClass by name instead.
resideInPath("/feature/data/..") and "\feature\data\.." never matched, so
withoutPath with a copied projectPath kept every file. Leading separators and
separators next to the '..' wildcard are now ignored. Package patterns are
unchanged.
Root path "X:\" (e.g. a subst drive) keeps its trailing separator, so
projectPath lost its leading separator: root-module files got
moduleName "main/kotlin/A.kt", sourceSetName "src", and module and
source-set scopes were empty. The root's trailing separator is now
ignored when building projectPath and scope path regex.
Add gradle/actions/setup-gradle to every job that runs Gradle so the wrapper,
dependencies and build cache are restored between runs. Run Check and Check
Test Project on pushes to develop so the default branch writes cache entries
that PR runs can read.
#1941 made scopeFromModule, scopeFromModules, scopeFromProject, scopeFromPackage,
scopeFromProduction and scopeFromTest throw IllegalArgumentException for a
non-existent module, a module without Kotlin files, a blank module name and an
empty module list. That is a breaking change, so restore the previous behaviour
of returning an empty scope. Gradle-style module paths and de-duplication of
module names are kept.
* Fail dependsOn when layer depends on undeclared layer

Restores v0.16.1 behaviour removed in #1505: a layer configured with
dependsOn may only depend on the declared layers.

* Enable Gradle tooling parallel sync
* Add KoRule parameter to assertions

Assertions accept an optional KoRule (title, rationale, howToFix, goodExample, badExample) that is displayed in the failure message, so developers and AI agents know what the rule checks, why it exists and how to fix the violation.

* Suppress LongParameterList on internal assert functions
#2092)

Cycle detection threw KoInternalException when the cycle was reachable from
the first declared layer but did not include it. Track the DFS path and
report the cycle found on the back edge.
Layer dependency checks matched the whole import name (including class
names) against layer packages, so a class name equal to a layer package
segment caused false failures (import com.foo.Data vs '..data..') and
missed violations (import com.app.presentation.Domain inside '..domain..').
Match the package of the imported declaration instead.
isGeneric, isNullable and isFunctionType now inspect the parsed type instead of
regex/text heuristics, and KoTypeParameterDeclaration.name returns the bare
parameter name (without variance modifier and upper bound).
Suppressed declarations were removed before the null/empty check, so a
suppressed non-null declaration failed assertNotNull and a fully
suppressed list failed assertNotEmpty. Suppression filtering now applies
only to assertNull/assertEmpty.
…2098)

scopeFromDirectory/scopeFromExternalDirectory walked the directory without the
project directory filter, so generated files (KSP, Hilt), .gradle, .idea,
.claude worktrees and node_modules were parsed. Project directories now reuse
the cached project scan; other directories are walked with the filter rooted at
the requested directory. An explicitly requested ignored directory is still
scanned.
…2097)

* Respect Suppress for packages, annotations, KDocs, KDoc tags and type arguments

Suppression walked up parents only via KoContainingDeclarationProvider. Packages, KDocs and KDoc tags don't implement it, and annotations and type arguments implement it internally returning the file, so file-level or parent-level @Suppress was ignored.

* Use resolvable imports in import suppression snippets
Scopes combined with plus/plusAssign, scopeFromSourceSets with equivalent
names and overlapping directories no longer contain a file twice.
Paths with ./ and ../ segments resolve to the same scope as the clean path.
Any annotation whose text contained the quoted test name (e.g.
@deprecated("myTest")) was dropped from the asserted list, so the
assertion silently passed. Now only @Suppress annotations are skipped.
* Make type arguments non-null and align empty-input filters

Map empty input to presence check for type arguments and list filters on nullable properties.

* Make function type parameters non-null

hasAllParameters is vacuously true for types without parameters, same as other providers.
Files with a lone CR or CR CR LF line endings made location throw
"Wrong line separators", which also broke assertion failure messages.
…rs (#2105)

Parameter and context parameter representsType now also matches the fully
qualified name of the type's source declaration. representsTypeOf<T>() matches
by fully qualified name only, so same-named types in other packages no longer match.
KClass-based checks (hasTypeOf, hasReturnTypeOf, hasParentOf, hasTypeArgumentOf,
...) now resolve import aliases to the imported declaration, and the
indirect-parent search continues through aliased parents. hasChildOf and
hasAllChildrenOf compare fully qualified names only, so a class with the same
short name in another package no longer matches.
…2108)

The property returned only direct companion objects, while
companionObjects() defaults to includeNested = true, so the two
calls returned different results for the same list.
Delete DeprecatedKoDeclarationCastProviderListExt (duplicates of the
KoDeclarationCastProvider list extensions), drop stale
@RemoveInVersion("0.19.0") markers, and remove the 7 val list
properties so each cast kind has a single xDeclarations(predicate) accessor.
Annotation fullyQualifiedName and sourceDeclaration now resolve nested
annotation classes visible from the annotated declaration, e.g. @inner on a
member of Outer resolves to Outer.Inner. Nested types of a class are not
visible in its own annotations, matching Kotlin scoping.
nestedDeclarations was created outside the loop over local functions,
so declarations nested in one local function were re-added for every
following local function.
Layer rootPackage without trailing '..' now covers a single package,
e.g. Layer("App", "com.example") matches com.example only, so it does
not overlap layers defined in its subpackages. Package matching already
supported exact packages; only Layer validation rejected them.
…pes (#2112)

For types with an annotation or modifier inside the nullable parentheses,
e.g. (@composable () -> Unit)? or (suspend () -> Unit)?, the first child of
KtNullableType is the modifier list, not the type. Use KtNullableType.innerType
and read annotations from the nullable type's modifier list.
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

📦 Konsist snapshot published

Version 1.0.0-beta.1-pr2115-20261104.063336-1
Latest snapshot 1.0.0-beta.1-pr2115-SNAPSHOT
Commit 17f889f
Build Publish #210
Artifact konsist-1.0.0-beta.1-pr2115-20261104.063336-1.jar (pom)
repositories {
    maven("https://central.sonatype.com/repository/maven-snapshots/")
}

dependencies {
    testImplementation("com.lemonappdev:konsist:1.0.0-beta.1-pr2115-20261104.063336-1")
}

Snapshots are removed from the Central snapshots repository after 90 days.

@igorwojda
igorwojda merged commit 464bbed into main Nov 4, 2026
78 checks passed
@igorwojda
igorwojda deleted the release/v1.0.0-beta.1 branch November 4, 2026 06:49
igorwojda added a commit that referenced this pull request Nov 4, 2026
Merge pull request #2115 from LemonAppDev/release/v1.0.0-beta.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant