diff --git a/.editorconfig b/.editorconfig index 9fe2fbc6c6..a9d4bb29e1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,19 +1,19 @@ root = true [*] -indent_style = tab -indent_size = 4 +indent_style = space +indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 # md (GitHub shows code fences with 8 spaces) [*.md] -indent_style = space -indent_size = 2 trim_trailing_whitespace = false [*.java] +indent_style = tab +indent_size = 4 # Doc: https://youtrack.jetbrains.com/issue/IDEA-170643#focus=streamItem-27-3708697.0-0 ij_java_imports_layout = $*,|,java.**,|,javax.**,|,org.**,|,com.**,|,com.diffplug.**,|,* ij_java_use_single_class_imports = true @@ -21,11 +21,11 @@ ij_java_class_count_to_use_import_on_demand = 999 ij_java_names_count_to_use_import_on_demand = 999 [*.xml.mustache] -indent_style = space +indent_size = 4 -[*.{yml,yaml}] -indent_style = space -indent_size = 2 +[*.template] +indent_style = tab +indent_size = 4 # Prevent unexpected automatic indentation when crafting test-cases [/testlib/src/main/resources/**] diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 210c929ecb..6cb781f13b 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,20 +1,20 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended", - ], - packageRules: [ - { - groupName: 'Ktlint', - matchPackageNames: [ - 'com.pinterest.ktlint:*', - ] - }, - { - groupName: 'OpenRewrite', - matchPackageNames: [ - 'org.openrewrite.recipe:*', - ], - }, - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended", + ], + packageRules: [ + { + groupName: 'Ktlint', + matchPackageNames: [ + 'com.pinterest.ktlint:*', + ] + }, + { + groupName: 'OpenRewrite', + matchPackageNames: [ + 'org.openrewrite.recipe:*', + ], + }, + ] } diff --git a/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java b/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java index 8244a36bfb..e17446552a 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2025 DiffPlug + * Copyright 2016-2026 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ private static class State extends NpmFormatterStepStateBase implements Serializ super(stepName, new NpmConfig( replaceDevDependencies( - NpmResourceHelper.readUtf8StringFromClasspath(EslintFormatterStep.class, "/com/diffplug/spotless/npm/eslint-package.json"), + NpmResourceHelper.readUtf8StringFromClasspath(EslintFormatterStep.class, "/com/diffplug/spotless/npm/eslint-package.json.template"), new TreeMap<>(devDependencies)), NpmResourceHelper.readUtf8StringFromClasspath(EslintFormatterStep.class, "/com/diffplug/spotless/npm/common-serve.js", diff --git a/lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java b/lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java index e272b2ebdf..e12107d971 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2025 DiffPlug + * Copyright 2016-2026 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ private static class State extends NpmFormatterStepStateBase implements Serializ super(stepName, new NpmConfig( replaceDevDependencies( - NpmResourceHelper.readUtf8StringFromClasspath(PrettierFormatterStep.class, "/com/diffplug/spotless/npm/prettier-package.json"), + NpmResourceHelper.readUtf8StringFromClasspath(PrettierFormatterStep.class, "/com/diffplug/spotless/npm/prettier-package.json.template"), new TreeMap<>(devDependencies)), NpmResourceHelper.readUtf8StringFromClasspath(PrettierFormatterStep.class, "/com/diffplug/spotless/npm/common-serve.js", diff --git a/lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java b/lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java index 2e9fc13b58..34bb39795e 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2025 DiffPlug + * Copyright 2016-2026 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,7 @@ public static class State extends NpmFormatterStepStateBase implements Serializa public State(String stepName, Map versions, File projectDir, File buildDir, File cacheDir, NpmPathResolver npmPathResolver, @Nullable TypedTsFmtConfigFile configFile, @Nullable Map inlineTsFmtSettings) throws IOException { super(stepName, new NpmConfig( - replaceDevDependencies(NpmResourceHelper.readUtf8StringFromClasspath(TsFmtFormatterStep.class, "/com/diffplug/spotless/npm/tsfmt-package.json"), new TreeMap<>(versions)), + replaceDevDependencies(NpmResourceHelper.readUtf8StringFromClasspath(TsFmtFormatterStep.class, "/com/diffplug/spotless/npm/tsfmt-package.json.template"), new TreeMap<>(versions)), NpmResourceHelper.readUtf8StringFromClasspath(PrettierFormatterStep.class, "/com/diffplug/spotless/npm/common-serve.js", "/com/diffplug/spotless/npm/tsfmt-serve.js"), diff --git a/lib/src/main/resources/com/diffplug/spotless/npm/eslint-package.json b/lib/src/main/resources/com/diffplug/spotless/npm/eslint-package.json.template similarity index 100% rename from lib/src/main/resources/com/diffplug/spotless/npm/eslint-package.json rename to lib/src/main/resources/com/diffplug/spotless/npm/eslint-package.json.template diff --git a/lib/src/main/resources/com/diffplug/spotless/npm/prettier-package.json b/lib/src/main/resources/com/diffplug/spotless/npm/prettier-package.json.template similarity index 100% rename from lib/src/main/resources/com/diffplug/spotless/npm/prettier-package.json rename to lib/src/main/resources/com/diffplug/spotless/npm/prettier-package.json.template diff --git a/lib/src/main/resources/com/diffplug/spotless/npm/tsfmt-package.json b/lib/src/main/resources/com/diffplug/spotless/npm/tsfmt-package.json.template similarity index 100% rename from lib/src/main/resources/com/diffplug/spotless/npm/tsfmt-package.json rename to lib/src/main/resources/com/diffplug/spotless/npm/tsfmt-package.json.template diff --git a/lib/src/test/java/com/diffplug/spotless/npm/NodeServerLayoutTest.java b/lib/src/test/java/com/diffplug/spotless/npm/NodeServerLayoutTest.java index 229435eb21..4a09f54f8b 100644 --- a/lib/src/test/java/com/diffplug/spotless/npm/NodeServerLayoutTest.java +++ b/lib/src/test/java/com/diffplug/spotless/npm/NodeServerLayoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 DiffPlug + * Copyright 2025-2026 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ void itCalculatesDifferentNodeModulesDirForDifferentServeJs() throws IOException } static String prettierPackageJson(Map dependencies) { - String templateContent = NpmResourceHelper.readUtf8StringFromClasspath(NodeServerLayoutTest.class, "/com/diffplug/spotless/npm/prettier-package.json"); + String templateContent = NpmResourceHelper.readUtf8StringFromClasspath(NodeServerLayoutTest.class, "/com/diffplug/spotless/npm/prettier-package.json.template"); String dependenciesList = dependencies.entrySet().stream() .map(entry -> "\"%s\": \"%s\"".formatted(entry.getKey(), entry.getValue())) .reduce((a, b) -> a + ",\n " + b)