Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SpacingBetweenPackageAndImports issue for scripts without packages #1947

Merged
merged 4 commits into from Sep 28, 2019
Merged

Fix SpacingBetweenPackageAndImports issue for scripts without packages #1947

merged 4 commits into from Sep 28, 2019

Conversation

schalkms
Copy link
Member

Both a Kotlin file and a Kotlin script can be declared with and without
a package declaration. This commit checks if the class even contains a
package declaration for both .kt and .kts files.
Closes #1937

Both a Kotlin file and a Kotlin script can be declared with and without
a package declaration. This commit checks if the class even contains a
package declaration for both .kt and .kts files.
Closes #1937
Copy link
Member Author

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review: @sschuberth

@codecov-io
Copy link

codecov-io commented Sep 25, 2019

Codecov Report

Merging #1947 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1947      +/-   ##
============================================
- Coverage     80.75%   80.74%   -0.02%     
+ Complexity     2001     2000       -1     
============================================
  Files           329      329              
  Lines          5587     5587              
  Branches       1038     1038              
============================================
- Hits           4512     4511       -1     
  Misses          537      537              
- Partials        538      539       +1
Impacted Files Coverage Δ Complexity Δ
...ekt/rules/style/SpacingBetweenPackageAndImports.kt 80% <0%> (-4%) 22 <2> (-1)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update faff9f4...676a225. Read the comment docs.

@arturbosch arturbosch added this to the 1.1.0 milestone Sep 26, 2019
@schalkms schalkms merged commit aee6d20 into detekt:master Sep 28, 2019
sowmyav24 pushed a commit to sowmyav24/detekt that referenced this pull request Oct 1, 2019
detekt#1947)

* Revert "Fix SpacingBetweenPackageAndImports issue for KTS (detekt#1939)"

This reverts commit faff9f4.

* Fix SpacingBetweenPackageAndImports issue for scripts without packages

Both a Kotlin file and a Kotlin script can be declared with and without
a package declaration. This commit checks if the class even contains a
package declaration for both .kt and .kts files.
Closes detekt#1937

* Use more sophisticated package check

* Refactor SpacingBetweenPackageAndImports rule

This rule doesn't use a mutable variable anymore.
@schalkms schalkms deleted the fix-#1937 branch November 8, 2019 18:12
smyachenkov pushed a commit to smyachenkov/detekt that referenced this pull request Dec 9, 2019
detekt#1947)

* Revert "Fix SpacingBetweenPackageAndImports issue for KTS (detekt#1939)"

This reverts commit faff9f4.

* Fix SpacingBetweenPackageAndImports issue for scripts without packages

Both a Kotlin file and a Kotlin script can be declared with and without
a package declaration. This commit checks if the class even contains a
package declaration for both .kt and .kts files.
Closes detekt#1937

* Use more sophisticated package check

* Refactor SpacingBetweenPackageAndImports rule

This rule doesn't use a mutable variable anymore.
smyachenkov pushed a commit to smyachenkov/detekt that referenced this pull request Dec 9, 2019
detekt#1947)

* Revert "Fix SpacingBetweenPackageAndImports issue for KTS (detekt#1939)"

This reverts commit faff9f4.

* Fix SpacingBetweenPackageAndImports issue for scripts without packages

Both a Kotlin file and a Kotlin script can be declared with and without
a package declaration. This commit checks if the class even contains a
package declaration for both .kt and .kts files.
Closes detekt#1937

* Use more sophisticated package check

* Refactor SpacingBetweenPackageAndImports rule

This rule doesn't use a mutable variable anymore.
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.

Bogus SpacingBetweenPackageAndImports violation for KTS without package
5 participants