Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion codeflash/languages/java/gradle_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
'spotbugsMain', 'spotbugsTest',
'pmdMain', 'pmdTest',
'rat', 'japicmp',
'jarHell', 'thirdPartyAudit'
'jarHell', 'thirdPartyAudit',
'spotlessCheck', 'spotlessApply', 'spotlessJava', 'spotlessKotlin', 'spotlessScala'
]
}.configureEach {
enabled = false
Expand Down
2 changes: 2 additions & 0 deletions codeflash/languages/java/maven_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"-Denforcer.skip=true",
"-Djapicmp.skip=true",
"-Derrorprone.skip=true",
"-Dspotless.check.skip=true",
"-Dspotless.apply.skip=true",
"-Dmaven.compiler.failOnWarning=false",
"-Dmaven.compiler.showWarnings=false",
]
Expand Down
25 changes: 25 additions & 0 deletions tests/test_languages/test_java/test_build_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,28 @@ def test_adds_dependency_to_nested_module(self, tmp_path):
assert result is True
nested_build = (nested / "build.gradle.kts").read_text(encoding="utf-8")
assert "codeflash-runtime" in nested_build


class TestValidationSkipFlags:
"""Tests that validation skip flags include all known static analysis and formatting plugins."""

def test_maven_skip_flags_include_spotless(self):
from codeflash.languages.java.maven_strategy import _MAVEN_VALIDATION_SKIP_FLAGS

flags_str = " ".join(_MAVEN_VALIDATION_SKIP_FLAGS)
assert "-Dspotless.check.skip=true" in flags_str
assert "-Dspotless.apply.skip=true" in flags_str

def test_maven_skip_flags_include_all_known_plugins(self):
from codeflash.languages.java.maven_strategy import _MAVEN_VALIDATION_SKIP_FLAGS

flags_str = " ".join(_MAVEN_VALIDATION_SKIP_FLAGS)
for plugin in ["rat", "checkstyle", "spotbugs", "pmd", "enforcer", "japicmp", "errorprone", "spotless"]:
assert plugin in flags_str, f"Missing skip flag for {plugin}"

def test_gradle_skip_script_includes_spotless(self):
from codeflash.languages.java.gradle_strategy import _GRADLE_SKIP_VALIDATION_INIT_SCRIPT

assert "spotlessCheck" in _GRADLE_SKIP_VALIDATION_INIT_SCRIPT
assert "spotlessApply" in _GRADLE_SKIP_VALIDATION_INIT_SCRIPT
assert "spotlessJava" in _GRADLE_SKIP_VALIDATION_INIT_SCRIPT
Loading