Kotlin file could start with `@file:...` instead of `package ...`
See original GitHub issueThe regex for finding the top of the file (where the license should go) doesn’t work when you start your file with:
@file:JvmName("SomeFileName")
package ... // ect...
The default header regex for kotlin should support starting the file with the @file
annotation.
As a note, the compiler will only let you legally put @file:...
annotations above the package statement.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Packages and imports - Kotlin
Packages and imports. A source file may start with a package declaration: package org.example fun printMessage() { /*.
Read more >Calling Kotlin from Java -- error: package demo does not exist
The import of the kotlin file seems missing in your java file. Share.
Read more >Migrating build logic from Groovy to Kotlin - Gradle User Manual
To use the Kotlin DSL, simply name your files build.gradle.kts instead of build.gradle . The settings file, settings.gradle , can also be renamed ......
Read more >Configure your build - Android Developers
There are a few Gradle build configuration files that are part of the standard project structure for an Android app. Before you can...
Read more >Add items to your project | IntelliJ IDEA Documentation
Name the new file and specify its extension, for example: File.js, and press Enter . ... You can create a class together with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released in
3.5.2
.The
@file
issue that @JLLeitschuh brings up is more battle-tested than what we have now. We don’t need the perfect regex, not even sure that we need a unit test. Just alicenseFile()
incantation that works better on Kotlin codebases than what we have now.