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

EmptyFunctionBlock should flag empty functions defined inside other functions #998

Closed
egor-n opened this issue Jul 16, 2018 · 1 comment
Closed
Milestone

Comments

@egor-n
Copy link
Contributor

egor-n commented Jul 16, 2018

Expected Behavior

Functions defined inside functions should follow the same rules.

fun a() {
    fun b() {}
}

fun b() should be reported as an empty function.

Current Behavior

// EmptyFunctionBlockSpec.kt

given("an empty function inside a another function") {
	it("should flag the empty function") {
		val code = """
		private class A {
			fun a() {
				fun b() {}
			}
		}
		"""
		assertThat(subject.lint(code)).hasSize(1)
	}
}

This test case fails.

@arturbosch arturbosch added this to the RC8 milestone Sep 10, 2018
DSamaryan pushed a commit to DSamaryan/detekt that referenced this issue Oct 18, 2018
@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants