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
14 changes: 4 additions & 10 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ on:
branches: [ main ]

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

jobs:
docc:
name: DocC
runs-on: macos-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
permissions:
contents: read
steps:
- name: Add ssh key
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a "$SSH_AUTH_SOCK" > /dev/null
ssh-add - <<< "${{ secrets.TINDER_GITHUB_SSH_KEY }}"
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
run: make docs open="no" DERIVED_DATA_PATH="$(mktemp -d)"
17 changes: 6 additions & 11 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@ on:
branches: [ main ]

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

jobs:
swift:
name: Swift
runs-on: macos-latest
permissions:
contents: read
env:
SIMULATOR: iPhone 15
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
SIMULATOR: iPhone 17
steps:
- name: Add ssh key
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a "$SSH_AUTH_SOCK" > /dev/null
ssh-add - <<< "${{ secrets.TINDER_GITHUB_SSH_KEY }}"
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Download swiftlint binary
run: swift package resolve
- name: Lint
run: >
"$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)"
"$(find ".build/artifacts/swiftlint" -path "*macos*" -type f -name swiftlint -perm +111 -print -quit)"
lint --strict --reporter github-actions-logging
- name: Resolve package dependencies
run: xcodebuild -resolvePackageDependencies
Expand Down
8 changes: 5 additions & 3 deletions .swiftlint-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ only_rules:
- accessibility_label_for_image
- accessibility_trait_for_button
- anonymous_argument_in_multiline_closure
- anyobject_protocol
- array_init
- async_without_await
- attribute_name_spacing
# - attributes
- balanced_xctest_lifecycle
- blanket_disable_command
Expand Down Expand Up @@ -94,7 +95,6 @@ only_rules:
- implicitly_unwrapped_optional
- inclusive_language
# - indentation_width
- inert_defer
- invalid_swiftlint_command
- is_disjoint
- joined_default_parameter
Expand Down Expand Up @@ -145,6 +145,7 @@ only_rules:
- opening_brace
- operator_usage_whitespace
- operator_whitespace
- optional_data_string_conversion
- optional_enum_case_matching
- orphaned_doc_comment
- overridden_super_call
Expand All @@ -155,6 +156,7 @@ only_rules:
- prefer_nimble
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
- prefer_type_checking
- prefer_zero_over_explicit_init
# - prefixed_toplevel_constant
- private_action
Expand All @@ -177,6 +179,7 @@ only_rules:
- redundant_objc_attribute
- redundant_optional_initialization
- redundant_self_in_closure
- redundant_sendable
- redundant_set_access_control
# - redundant_string_enum_value
- redundant_type_annotation
Expand Down Expand Up @@ -224,7 +227,6 @@ only_rules:
- unneeded_synthesized_initializer
- unowned_variable_capture
- untyped_error_in_catch
- unused_capture_list
- unused_closure_parameter
- unused_control_flow_label
- unused_enumerated
Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [Open Package](#open-package)
- [Lint Package](#lint-package)
- [Testing](#testing)
- [Creating Releases](#creating-releases)

## Open Package
Expand All @@ -28,6 +29,14 @@ To run analysis rules:
make analyze
```

## Testing

To re-record all existing snapshot references, delete all using the following command and then run the tests.

```
make delete-snapshots
```

## Creating Releases

Releases are made [on the GitHub website](https://github.com/Tinder/Nodes-Tree-Visualizer/releases/new).
Expand All @@ -36,7 +45,7 @@ In all of the following steps, `X.X.X` is a placeholder to be substituted with t

- 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 `Nodes-Tree-Visualizer vX.X.X` (__WITH__ `v` prefix)
- Enter the release title formatted as `Nodes Tree Visualizer 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
Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.PHONY: serve
serve:
@npm install --prefix server >/dev/null 2>&1
node server/index.js

.PHONY: open
open: fix
open:
Expand Down Expand Up @@ -44,6 +39,14 @@ analyze:
swift package plugin \
swiftlint analyze --strict --progress --reporter "$(format)" --compiler-log-path "$$XCODEBUILD_LOG"

.PHONY: delete-snapshots
delete-snapshots:
@for snapshots in $$(find Tests -type d -name "__Snapshots__"); \
do \
rm -rf "$$snapshots"; \
echo "Deleted $$snapshots"; \
done

.PHONY: docs
docs: target ?= Nodes-Tree-Visualizer
docs: destination ?= generic/platform=iOS
Expand All @@ -57,9 +60,14 @@ docs:
-destination "$(destination)" \
-derivedDataPath "$(DERIVED_DATA_PATH)" \
-skipPackagePluginValidation \
OTHER_DOCC_FLAGS="--warnings-as-errors"
$(if $(filter $(open),OPEN),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",)
@$(if $(filter $(open),OPEN),open "$(ARCHIVE_PATH)/$(target).doccarchive",:)

.PHONY: serve
serve:
@npm install --prefix server >/dev/null 2>&1
node server/index.js
37 changes: 19 additions & 18 deletions Package.resolved

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

40 changes: 31 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// swift-tools-version:5.8
// swift-tools-version:5.10

import Foundation
import PackageDescription

let environment = ProcessInfo.processInfo.environment

let treatWarningsAsErrors = environment["CI"] == "true"
let enableSwiftLintBuildToolPlugin = environment["CODEQL_DIST"] == nil

let package = Package(
name: "Nodes-Tree-Visualizer",
platforms: [
Expand All @@ -15,17 +21,17 @@ let package = Package(
],
dependencies: [
.package(
url: "git@github.com:Tinder/Nodes.git",
url: "https://github.com/Tinder/Nodes.git",
"0.0.0"..<"2.0.0"),
.package(
url: "https://github.com/socketio/socket.io-client-swift.git",
exact: "16.1.1"),
.package(
url: "https://github.com/realm/SwiftLint.git",
exact: "0.56.2"),
exact: "0.59.1"),
.package(
url: "https://github.com/Quick/Nimble.git",
exact: "13.4.0"),
exact: "14.0.0"),
],
targets: [
.target(
Expand All @@ -45,11 +51,27 @@ let package = Package(

package.targets.forEach { target in

target.swiftSettings = [
.enableExperimentalFeature("StrictConcurrency"),
let types: [Target.TargetType] = [
.regular,
.test,
.executable,
]

target.plugins = [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
guard types.contains(target.type)
else { return }

target.swiftSettings = (target.swiftSettings ?? []) + [.enableExperimentalFeature("StrictConcurrency")]

// if treatWarningsAsErrors {
// target.swiftSettings = (target.swiftSettings ?? []) + [
// .treatAllWarnings(as: .error),
// .treatWarning("DeprecatedDeclaration", as: .warning),
// ]
// }

if enableSwiftLintBuildToolPlugin {
target.plugins = (target.plugins ?? []) + [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
}
}