Update dependency com.lemonappdev:konsist to v0.16.0 - autoclosed #384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.11.0
->0.16.0
Release Notes
LemonAppDev/konsist (com.lemonappdev:konsist)
v0.15.1
What's Changed
Restore layer validation
Full Changelog: LemonAppDev/konsist@v0.15.0...v0.15.1
v0.15.0
What's Changed
1. Use Kotlin compiler
kotlin-compiler-embeddable
dependencyThis release updates Kotlin compiler dependency to
kotlin-compiler-embeddable
reducing dependency conflicts and simplifying dependency management.2. All all APIs accepting
varargs
now accept Kotlin collections (List
andSet
, etc.):💡 Improvements
kotlin-compiler
tokotlin-compiler-embeddable
by @igorwojda in #954Full Changelog: LemonAppDev/konsist@v0.14.0...v0.15.0
v0.14.0
What's Changed
1.0.0
, but this will be a big change, so instead we decided to follow more granular deprecation strategy to facilitate future upgrades. API with deprecation target for1.0.0
has beed updated to0.16.0
(#902). From now on deprecated methods will be available for 2 minor versions (until 1.0.0 release). After 1.0.0 release Konsist will follow semantic versioning scheme meaning breaking changes will be introduced only when major version of the Konsist changes. Deprecated methods (with initial removal targeted for1.0.0
) will be removed in next release (deprecation target has bee updated). Please update your by removingDeprecated
Konsist API to facilitate future migration.Thanks you for your feedback 🙏
New Contributors
1. Added
declaration references
Konsist understands the code's structure better. This new feature, highly requested by the community, provides link between declarations, giving you more control over code quality checks. Konsist now works with declarations directly, allowing you to precisely verify type properties, inheritance relationships, and more e.g.
All parent interfaces have
actual
modifier:All function parameters are interfaces:
All classes have test classes with
Test
annotation and a name containing its name:All interfaces have children (child classes and child interfaces) resided in
..somepackage..
package:See Declaration References docs.
2. Retrieve indirect parents
The
indirectParents
parameter has been added to parent retrieval methods (parents()
,hasParentClass()
,hasAllParentInterfacesOf
etc.). This parameter specifies whether or not to include parents such as parent of the parent. By default,indirectParents
isfalse
e.g.For above inheritance hierarchy is possible to retrieve direct parents of
ClassC
(ClassB
) as well as all parents present in the codebase (ClassB
andClassC
).3. Improved
assertArchitecture
methodsFollowing other
assert
methods, we added thetestName
andadditionalMessage
arguments to theassertArchitecture
methods.You can now manually set the test name that will be displayed in the test failure message and used to suppress tests. This is useful for
Kotest
and dynamic tests.4. Added support for variables
Now Konsist will allow to access and verify variables located inside functions, init blocks, getters, setters and enum constants.
5. Ability to check
tacit
typeNow Konsist can check whether the properties or variables have a tacit type. Tacit type means that the declaration has an explicitly or implicitly specified type.
One scenario where
tacit type
is useful is verification ofsut
(system under test / class under test) existence:6. Ability to check
sourceType
andbareSourceType
Now Konsist provides
sourceType
andbareSourceType
properties for better type analysis:One scenario where
bareSourceType
is useful is naming verification of property withList
type:7. Ability to check whether a property is read-only
Now Konsist provides
isReadOnly
property that checks whether a property is specified with aval
modifier:Complete list of changes
🐛 Bug Fixes
💡 Improvements
testName
ToassertArchitecture
by @nataliapeterwas in #712null
values in representsType() by @yonatankarp in #719toString
by @nataliapeterwas in #735isKotlinType
Property Where Generic Types Where Treated As Kotlin Collections by @igorwojda in #754KoSourceAndAliasTypeProviderCore.baseSourceType
by @igorwojda in #753sourcetype
stripping?
by @igorwojda in #756isKotlinBasicType
AndisKotlinCollectionType
by @igorwojda in #757baseSourceType
TobareSourcetype
by @igorwojda in #758bareType
by @igorwojda in #759check_kttxt_snippets
by @igorwojda in #764indirectParents=false
Parameter by @nataliapeterwas in #726containingDeclaration
by @nataliapeterwas in #715konsist-declaration-tester
by @nataliapeterwas in #858hasTacitType
by @nataliapeterwas in #773Unit
,Any
andNothing
by @nataliapeterwas in #926sourceX
Properties by @nataliapeterwas in #927sourceX
toasXDeclaration()
by @nataliapeterwas in #930📕 Documentation
🏗️ CI
📦 Dependency Upgrade
Full Changelog: LemonAppDev/konsist@v0.13.0...v0.14.0
v0.13.0
What's Changed
This release focuses on improving KoTest support and improve assertions (Konsist docs).
From this point, Konsit will have a first-class KoTest support meaning that every following release will be developed with KoTest support in mind. At the moment we have addressed known issues and improved the API. If you think something is still missing just let us know on Slack. We would like to add more KoTest snippets to our documentation, but first, we want to see how you are using Konsist with KoTest (let us know).
On top of that, we have introduced, new assertions, multiple improvements and bug fixes (thanks to your feedback🙏).
Some of our efforts happen in the background. For instance, we improve documentation are enhance the CI setup and release process to facilitate a more frequent release schedule. Additionally, we aim to make the Konsist backlog and roadmap public to boost transparency and community involvement.
Big claps go towards @JonathanSarco for his open-source contributions to the Konsist codebase 👏.
1. Improved Assertions
We have relaxed the empty list behavior. Konsist test will pass on an empty list to match the behavior of methods in Kotlin collection processing:
We have also added a
strict
parameter to restore old behavior:The
assertTrue
andassertFalse
can be called on a single declaration:We have added new assertions. Now you can verify if certain queries result in empty or non-empty lists with
assertEmpty()
andassertNotEmpty()
:You can now check whether a specific query is invoked on a null or non-null declaration.
The
assertArchitecture
assertion on the list of files (previously it worked only onKoScope
):The additionalMessage param allows to provision of additional messages that will be displayed with the failing test. This may be a more detailed description of the problem or a hint on how to fix the issue:
2. Improved KoTest Support
We've allowed assertions for individual declaration (previously list of declarations was required).
Due to Kotlin/JVM limitation, the test name has to be passed manually for each
KoTest
test. We have added a dedicatedtestName
argument (assertTrue
andassertFalse
methods). The test name is used in two ways - as a test name displayed in the failing test crash and as asuppressName
used for suppressing tests. While this solution may not be perfect (unlike JUnit tests which don't require this), it's still effective and works well. We are open to making it better, but ATM we are stuck. The upcoming The K2 Compiler may provide a more convenient alternative.With the new
testName
parameter the KoTest test can be now suppressed:We have added multiple KoTest starter projects. Each project has
Konsist
andKoTest
preconfigured configured and a singleKoTest
test:We have also updated snippets to include a few KoTest examples (help us with adding a few more). The entire Konsist documentation was updated to take KoTest into consideration.
3. Added support for getters & setters
Now Konsist will allow to access and verify setters and getters. For example, now it is possible to verify if a given property has a
getter
(orsetter
):Konsist .scopeFromProject() .properties() .getters .assertTrue { it.hasBlockBody }
4. Ability to check block body and expression body
With declarations such as functions, getters, and setters you can now they the type of the body (
block
orexpression
):Konsist .scopeFromProject() .functions() .assertTrue { it.hasExpressionBody}
Konsist .scopeFromProject() .properties() .getters .assertTrue { it.hasBlockBody }
5. Ability to check return value
You can check if functions have a return value:
Konsist .scopeFromProject() .functions() .assertTrue { it.hasReturnValue }
You can inspect return value further
6. Ability to inspect property value
You can check if properties have a value:
Konsist .scopeFromProject() .properties() .assertTrue { it.hasValue() }
Assert if property has a given value:
Filter properties with given value:
7. Added
withName/withoutName
with predicate parameterNow it is possible to call
withName
andwithoutName
with the specified predicate:8. Improved
hasX
methodsWe have deprecated all
containsX
methods and instead added some methods withhas
prefixes (likehasX
,hasAllX
etc.):9. Improved Scope Creation
We are continuing our exploration of JGit and other APIs to enhance various development workflows e.g. a way to run Konsist Tests only on files modified in a given PR. We have added a new way of creating the scope:
What’s Next?
We are hearing the community feedback. The top 1 requested feature is the
declaration references
. We want to enable a way to retrieve parents (of a given class/interface/companion object) as Konsist declarations, rather than string names. You will be able to verify the properties of the parent in the Konsist test. This API is not finalized yet, but we are aiming to exposeparents
property containing a list of Konsist declarations:We also want to take a look at architecture assertions. Exact changes are quite a vague ATM, but we have a few community-driven threads to process and rethink our approach. We will consider adding “optional/empty layers” and add a few other tweaks to the Konsist API.
Thank you for your engagement using Konsist 🙏 (if you got here you must be really engaged Konsist community member congratulations 🥳). If you are missing something let us know.
Complete list of changes:
KoReturnTypeProvider
ToKoReturnProvider
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/668value
To KoPropertyDeclaration by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/682🐛 Bug Fixes
Properties Are Declared Before Functions
Test Treat Secondary Constructor As Function by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/667fullyQualifiedName
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/567KoImplementationProvider
ToKoInitializerProvider
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/681hasBlockBody
In KoBodyProvider Returns True When Declaration Has No Body by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/680KoAssertionFailedException
InassertArchitecture
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/671suppressName
TotestName
And Update Error Logic by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/670💡 Improvements
containsX
TohasX
And AddhasAllX
Methods by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/592assert
On Single Declaration by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/525KoAssertionFailedException
Instead OfKoCheckFailedException
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/669hasExpressionBody
AndhasBlockBody
To KoFunctionDeclaration by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/652suppresName
Parameter With KoTest by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/651https://github.com/LemonAppDev/konsist/pull/652hasReturnValue
To KoFunctionDeclaration by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/657assertEmpty
AndassertNotEmpty
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/648assertTrue
AndassertFalse
Methods by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/616suppressName
parameter toassertTrue
andassertFalse
by @JonathanSarco in https://github.com/LemonAppDev/konsist/pull/557KoTest
Dependency TointegrationTest
by @igorwojda in https://github.com/LemonAppDev/konsist/pull/601.hasModifiers()
by @JonathanSarco in https://github.com/LemonAppDev/konsist/pull/618withName
AndwithoutName
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/580hasX
Methods Are In Provider by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/563withConstructor
TowithConstructors
AndwithoutConstructor
TowithoutConstructors
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/565scopeFromFiles
by @igorwojda in https://github.com/LemonAppDev/konsist/pull/588📕 Documentation
DeveloperReadMe
Update Naming Conventions Section by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/679JetPack Compose
preview snippet by @igorwojda in https://github.com/LemonAppDev/konsist/pull/658companion objects are last declarations in the class
by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/617KoTest
Sample Projects by @igorwojda in https://github.com/LemonAppDev/konsist/pull/598includeNested
AndincludeLocal
Parameters by @nataliapeterwas in https://github.com/LemonAppDev/konsist/pull/583🏗️ CI
update-snippet
Script by [@nataliapeterwasConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.