Skip to content
Merged
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
1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/bazel.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: DocC

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer

jobs:
docc:
name: DocC
runs-on: macos-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Build
run: make docs open="no" DERIVED_DATA_PATH="$(mktemp -d)"
15 changes: 7 additions & 8 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ on:
branches: [ main ]

env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer

jobs:
swift:
name: Swift
runs-on: macos-13
runs-on: macos-latest
env:
SIMULATOR: iPhone 14
SIMULATOR: iPhone 15
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download swiftlint binary
run: swift package resolve
- name: Lint
run: |
DIRECTORY_NAME=$(echo "${PWD##*/}" | tr '[:upper:]' '[:lower:]')
"$(find ".build/artifacts/${DIRECTORY_NAME}" -type f -name swiftlint -perm +111 -print -quit)" \
run: >
"$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)"
lint --strict --reporter github-actions-logging
- name: Resolve package dependencies
run: xcodebuild -resolvePackageDependencies
Expand All @@ -33,7 +32,7 @@ jobs:
build-for-testing
-scheme "CollectionBuilders"
-destination "name=$SIMULATOR,OS=latest"
SWIFT_TREAT_WARNINGS_AS_ERRORS=YES
-skipPackagePluginValidation
- name: Test
run: >
xcodebuild
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@
# Xcode
*.xcworkspace/
*.xcodeproj/

# Bazel
bazel-*
9 changes: 9 additions & 0 deletions .swiftlint-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ only_rules:
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
# - contrasted_opening_brace
- control_statement
- convenience_type
- custom_rules
Expand Down Expand Up @@ -73,6 +74,7 @@ only_rules:
- file_name
- file_name_no_space
- file_types_order
- final_test_case
- first_where
- flatmap_over_map_reduce
- for_where
Expand Down Expand Up @@ -124,11 +126,13 @@ only_rules:
- multiple_closures_with_trailing_closure
- nesting
- nimble_operator
# - no_empty_block
- no_extension_access_modifier
- no_fallthrough_only
- no_grouping_extension
# - no_magic_numbers
- no_space_in_method_call
- non_optional_string_data_conversion
- non_overridable_class_declaration
- notification_center_detachment
- ns_number_init_as_function_reference
Expand All @@ -137,6 +141,7 @@ only_rules:
- nsobject_prefer_isequal
- number_separator
# - object_literal
# - one_declaration_per_file
- opening_brace
- operator_usage_whitespace
- operator_whitespace
Expand All @@ -146,6 +151,7 @@ only_rules:
- override_in_extension
- pattern_matching_keywords
- period_spacing
- prefer_key_path
- prefer_nimble
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
Expand Down Expand Up @@ -181,6 +187,7 @@ only_rules:
# - return_value_from_void_function
- self_binding
- self_in_property_initialization
# - shorthand_argument
- shorthand_operator
- shorthand_optional_binding
- single_test_class
Expand All @@ -189,6 +196,7 @@ only_rules:
- sorted_imports
- statement_position
- static_operator
- static_over_final_class
- strict_fileprivate
- strong_iboutlet
- superfluous_disable_command
Expand Down Expand Up @@ -221,6 +229,7 @@ only_rules:
- unused_control_flow_label
- unused_enumerated
- unused_optional_binding
- unused_parameter
- unused_setter_value
- valid_ibinspectable
- vertical_parameter_alignment
Expand Down
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
included:
- Plugins
- Sources
- Tests

Expand Down
15 changes: 0 additions & 15 deletions BUILD.bazel

This file was deleted.

37 changes: 17 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
# Contributing to CollectionBuilders

- [Dependencies](#dependencies)
- [Open Package in Xcode](#open-package-in-xcode)
- [Static Analysis](#static-analysis)
- [Testing](#testing)
- [Open Package](#open-package)
- [Lint Package](#lint-package)
- [Creating Releases](#creating-releases)

## Dependencies

Follow the [Swift Package Resources installation instructions](https://github.com/TinderApp/Swift-Package-Resources) to install tooling dependencies.

## Open Package in Xcode
## Open Package

> The file header comment template will also be installed.

```
make open
```

## Static Analysis
## Lint Package

> SwiftLint violations are visible in Xcode as well.

Package dependencies must be resolved to download the SwiftLint binary.

```
swift package resolve
```

To run SwiftLint from the command line:

```
Expand All @@ -39,8 +28,16 @@ To run analysis rules:
make analyze
```

To enable new rules whenever SwiftLint is upgraded to a new version:
## Creating Releases

```
make rules
```
Releases are made [on the GitHub website](https://github.com/Tinder/CollectionBuilders/releases/new).

In all of the following steps, `X.X.X` is a placeholder to be substituted with the actual semantic version for the release.

- Enter a semantic version as the new tag (__WITHOUT__ `v` prefix)
- Set the `main` branch as the target (it should be the default)
- Enter the release title formatted as `CollectionBuilders vX.X.X` (__WITH__ `v` prefix)
- Click on `Generate release notes`
- Leave `Set as a pre-release` unchecked
- Leave `Set as the latest release` checked
- Click `Publish release`
37 changes: 25 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#
# The SwiftLint recipes require the Swift Package Resources scripts to be installed.
#
# https://github.com/TinderApp/Swift-Package-Resources#installation
#

.PHONY: open
open: fix
open:
Expand All @@ -24,11 +18,12 @@ fix:
.PHONY: lint
lint: format ?= emoji
lint:
@swiftlint lint --strict --progress --reporter "$(format)"
@swift package plugin \
swiftlint lint --strict --progress --reporter "$(format)"

.PHONY: analyze
analyze: target ?= CollectionBuilders
analyze: destination ?= generic/platform=macOS
analyze: destination ?= generic/platform=iOS
analyze: format ?= emoji
analyze:
@DERIVED_DATA="$$(mktemp -d)"; \
Expand All @@ -38,10 +33,28 @@ analyze:
-destination "$(destination)" \
-derivedDataPath "$$DERIVED_DATA" \
-configuration "Debug" \
-skipPackagePluginValidation \
CODE_SIGNING_ALLOWED="NO" \
> "$$XCODEBUILD_LOG"; \
swiftlint analyze --strict --progress --reporter "$(format)" --compiler-log-path "$$XCODEBUILD_LOG"
swift package plugin \
swiftlint analyze --strict --progress --reporter "$(format)" --compiler-log-path "$$XCODEBUILD_LOG"

.PHONY: rules
rules:
@swiftlint rules | lint-rules
.PHONY: docs
docs: target ?= CollectionBuilders
docs: destination ?= generic/platform=iOS
docs: open ?= OPEN
docs: DERIVED_DATA_PATH = .build/documentation/data
docs: ARCHIVE_PATH = .build/documentation/archive
docs:
@mkdir -p "$(DERIVED_DATA_PATH)" "$(ARCHIVE_PATH)"
xcodebuild docbuild \
-scheme "$(target)" \
-destination "$(destination)" \
-derivedDataPath "$(DERIVED_DATA_PATH)" \
-skipPackagePluginValidation \
OTHER_DOCC_FLAGS="--warnings-as-errors"
@find "$(DERIVED_DATA_PATH)" \
-type d \
-name "$(target).doccarchive" \
-exec cp -R {} "$(ARCHIVE_PATH)/" \;
$(if $(filter $(open),OPEN),@open "$(ARCHIVE_PATH)/$(target).doccarchive",)
85 changes: 83 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading