Skip to content

Commit

Permalink
Bump com.diffplug.spotless from 6.25.0 to 7.0.1 (#298)
Browse files Browse the repository at this point in the history
Bumps com.diffplug.spotless from 6.25.0 to 7.0.1.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.diffplug.spotless&package-manager=gradle&previous-version=6.25.0&new-version=7.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Philip K. Warren <pkwarren@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and pkwarren authored Jan 13, 2025
1 parent ff20a33 commit bd84a7d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ intelliJPlatform = "2.2.1"
qodana = "2024.3.4"
kover = "0.9.1"
osdetector = "1.7.3"
spotless = "6.25.0"
spotless = "7.0.1"

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/build/buf/intellij/BufBundle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ private const val BUNDLE = "messages.BufBundle"
object BufBundle : DynamicBundle(BUNDLE) {

@JvmStatic
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
getMessage(key, *params)
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = getMessage(key, *params)
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import java.util.stream.Collectors
class BufFormatterService : AsyncDocumentFormattingService() {
override fun getFeatures(): Set<FormattingService.Feature> = emptySet()

override fun canFormat(file: PsiFile): Boolean =
file.isProtobufFile() && file.project.bufSettings.state.useBufFormatter && getFormattingReason() == FormattingReason.ReformatCode
override fun canFormat(file: PsiFile): Boolean = file.isProtobufFile() && file.project.bufSettings.state.useBufFormatter && getFormattingReason() == FormattingReason.ReformatCode

override fun createFormattingTask(request: AsyncFormattingRequest): FormattingTask? {
val context = request.context
Expand Down Expand Up @@ -99,11 +98,10 @@ class BufFormatterService : AsyncDocumentFormattingService() {
Implicit,
}

private fun getFormattingReason(): FormattingReason =
when (CommandProcessor.getInstance().currentCommandName) {
ReformatCodeProcessor.getCommandName() -> FormattingReason.ReformatCode
FormatterUtil.getReformatBeforeCommitCommandName() -> FormattingReason.ReformatCodeBeforeCommit
else -> FormattingReason.Implicit
}
private fun getFormattingReason(): FormattingReason = when (CommandProcessor.getInstance().currentCommandName) {
ReformatCodeProcessor.getCommandName() -> FormattingReason.ReformatCode
FormatterUtil.getReformatBeforeCommitCommandName() -> FormattingReason.ReformatCodeBeforeCommit
else -> FormattingReason.Implicit
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ class BufModuleConfigIndex : ScalarIndexExtension<BufModuleConfig>() {
// NOTE: No support for roots/excludes. Unsupported so far in the plugin and users should move to v1/v2.
result.add(BufModuleConfig(bufYamlFile.url, modulePath.url, moduleFullName = name))
}

"v1" -> {
result.add(BufModuleConfig(bufYamlFile.url, modulePath.url, moduleFullName = name))
}

"v2" -> {
val modules = YAMLUtil.getQualifiedKeyInFile(yamlFile, "modules")?.value as? YAMLSequence
if (modules != null && modules.items.isNotEmpty()) {
Expand All @@ -81,6 +83,7 @@ class BufModuleConfigIndex : ScalarIndexExtension<BufModuleConfig>() {
result.add(BufModuleConfig(bufYamlFile.url, modulePath.url, moduleFullName = name))
}
}

else -> return@DataIndexer emptyMap()
}
return@DataIndexer result.associateWith { null }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ import java.nio.file.Paths
internal class ModuleCacheV1(env: Map<String, String> = System.getenv()) : BaseModuleCache(env) {
override fun moduleDataRoot(): Path = Paths.get("$bufCacheDir/v1/module/data")

override fun moduleDataPathForModuleKey(key: ModuleKey): Path =
moduleDataRoot().resolve("${key.moduleFullName}/${key.commitID.toDashless()}")
override fun moduleDataPathForModuleKey(key: ModuleKey): Path = moduleDataRoot().resolve("${key.moduleFullName}/${key.commitID.toDashless()}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ internal class ModuleCacheV2(env: Map<String, String> = System.getenv()) : BaseM
-> {
// This is expected if we raced with another process
}

else -> {
// This can happen in a race - DirectoryNotEmpty
val message = e.message ?: ""
Expand Down

0 comments on commit bd84a7d

Please sign in to comment.