diff --git a/README.md b/README.md
index e57f71f..01695bc 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,6 @@ load(
swiftformat_pkg(
name = "format",
- config = "//:.swiftformat",
)
```
diff --git a/doc/rules_and_macros_overview.md b/doc/rules_and_macros_overview.md
index 6ad26cb..aa8930d 100755
--- a/doc/rules_and_macros_overview.md
+++ b/doc/rules_and_macros_overview.md
@@ -31,7 +31,7 @@ Formats the Swift source files using `nicklockwood/SwiftFormat`.
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| name | A unique name for this target. | Name | required | |
-| config | A swiftformat config file. | Label | optional | None |
+| config | A swiftformat config file. | Label | optional | @//:.swiftformat |
| output_suffix | The suffix to add to the output filename. | String | optional | "_formatted" |
| srcs | The Swift source files to format. | List of labels | required | |
| swift_version | The Swift version to be used by swiftformat
. You probably want to add this to your config file instead of adding it here. | String | optional | "" |
diff --git a/examples/simple/BUILD.bazel b/examples/simple/BUILD.bazel
index 1e1991b..912f901 100644
--- a/examples/simple/BUILD.bazel
+++ b/examples/simple/BUILD.bazel
@@ -39,6 +39,5 @@ swiftformat_update_all(
# test that the formatted files are in the workspace directory and copies
# the formatted files to the workspace directory.
swiftformat_pkg(
- name = "format",
- config = "//:.swiftformat",
+ name = "swiftformat",
)
diff --git a/examples/simple/Foo/BUILD.bazel b/examples/simple/Foo/BUILD.bazel
index d64454a..42f54f0 100644
--- a/examples/simple/Foo/BUILD.bazel
+++ b/examples/simple/Foo/BUILD.bazel
@@ -9,6 +9,5 @@ swift_library(
)
swiftformat_pkg(
- name = "format",
- config = "//:.swiftformat",
+ name = "swiftformat",
)
diff --git a/examples/swift_rule_helpers/Sources/App/BUILD.bazel b/examples/swift_rule_helpers/Sources/App/BUILD.bazel
index 824a78c..ba91ae1 100644
--- a/examples/swift_rule_helpers/Sources/App/BUILD.bazel
+++ b/examples/swift_rule_helpers/Sources/App/BUILD.bazel
@@ -7,7 +7,6 @@ load(
swiftformat_binary(
name = "simple",
srcs = ["main.swift"],
- swiftformat_config = "//:.swiftformat",
visibility = ["//:__subpackages__"],
deps = [
"//Sources/Foo",
diff --git a/examples/swift_rule_helpers/Sources/Foo/BUILD.bazel b/examples/swift_rule_helpers/Sources/Foo/BUILD.bazel
index 546a61e..10b9edf 100644
--- a/examples/swift_rule_helpers/Sources/Foo/BUILD.bazel
+++ b/examples/swift_rule_helpers/Sources/Foo/BUILD.bazel
@@ -7,6 +7,5 @@ swiftformat_library(
name = "Foo",
srcs = glob(["*.swift"]),
module_name = "Foo",
- swiftformat_config = "//:.swiftformat",
visibility = ["//:__subpackages__"],
)
diff --git a/examples/swift_rule_helpers/Tests/FooTests/MessageTests.swift b/examples/swift_rule_helpers/Tests/FooTests/MessageTests.swift
index aea90cc..38597e4 100644
--- a/examples/swift_rule_helpers/Tests/FooTests/MessageTests.swift
+++ b/examples/swift_rule_helpers/Tests/FooTests/MessageTests.swift
@@ -2,9 +2,9 @@
import XCTest
class MessageTests: XCTestCase {
- func test_init() throws {
- let value = "hello"
- let msg = Messsage(value = value)
- XCTAssertEqual(msg.value, value)
- }
+ func test_init() throws {
+ let value = "hello"
+ let msg = Messsage(value = value)
+ XCTAssertEqual(msg.value, value)
+ }
}
diff --git a/swiftformat/internal/swiftformat_format.bzl b/swiftformat/internal/swiftformat_format.bzl
index 190267c..3d4d9bc 100644
--- a/swiftformat/internal/swiftformat_format.bzl
+++ b/swiftformat/internal/swiftformat_format.bzl
@@ -60,6 +60,7 @@ to your config file instead of adding it here.\
"config": attr.label(
allow_single_file = True,
doc = "A swiftformat config file.",
+ default = "@//:.swiftformat",
),
"output_suffix": attr.string(
default = "_formatted",