question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin file could start with `@file:...` instead of `package ...`

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nedtwiggcommented, Sep 5, 2017

Released in 3.5.2.

0reactions
nedtwiggcommented, Aug 30, 2017

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 a licenseFile() incantation that works better on Kotlin codebases than what we have now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found