Skip to content

Improve code maintainability, fix typos, and enhance usability #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
BUILD_CONFIGURATION ?= debug

# Commonly used locations
SWIFT := "/usr/bin/swift"
SWIFT ?= $(shell command -v swift)
Copy link
Contributor

@adityaramani adityaramani Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason this was hardcoded to explicitly use the swift wrapper binary that ships with Xcode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this change?

ROOT_DIR := $(shell git rev-parse --show-toplevel)
BUILD_BIN_DIR := $(shell $(SWIFT) build -c $(BUILD_CONFIGURATION) --show-bin-path)

Expand Down
4 changes: 2 additions & 2 deletions Sources/Containerization/Image/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public struct Image: Sendable {
for manifest in index.manifests {
referenced.append(manifest.digest.trimmingDigestPrefix)
guard let m: Manifest = try? await contentStore.get(digest: manifest.digest) else {
// If the requested digest does not exist or is not a manifest. Skip.
// Its safe to skip processing this digest as it wont have any child layers.
// If the requested digest does not exist or is not a manifest, skip.
// It's safe to skip processing this digest as it won't have any child layers.
continue
}
let descs = m.layers + [m.config]
Expand Down
2 changes: 1 addition & 1 deletion Sources/ContainerizationEXT4/EXT4+Format.swift
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ extension EXT4 {
var diskSize = dataSize
var minimumDiskSize = (blockGroupSize.blockGroups - 1) * self.blocksPerGroup + 1
if blockGroupSize.blockGroups == 1 {
minimumDiskSize = self.blocksPerGroup // atleast 1 block group
minimumDiskSize = self.blocksPerGroup // at least 1 block group
}
if diskSize < minimumDiskSize { // for data + metadata
diskSize = minimumDiskSize
Expand Down
2 changes: 1 addition & 1 deletion Sources/ContainerizationOCI/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ extension Platform: Hashable {
// then, there is a possibility that for arm64 architecture, the variant may be set to nil
// In that case, the variant should be assumed to v8
if lhs.architecture == "arm64" && rhs.architecture == "arm64" {
// The following checks effictively verify
// The following checks effectively verify
// that one operand has nil value and other has "v8"
if lhs.variant == nil || rhs.variant == nil {
if lhs.variant == "v8" || rhs.variant == "v8" {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ContainerizationOS/Command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ extension Command {

/// Create a posix_spawn file actions set of fds to pass to the new process
private func createFileset() throws -> (null: FileHandle, handles: [FileHandle]) {
// grab dev null incase a handle passed by the user is nil
// grab dev null in case a handle passed by the user is nil
let null = try openDevNull()
var files = [FileHandle]()
files.append(stdin ?? null)
Expand Down
2 changes: 1 addition & 1 deletion Tests/ContainerizationOCITests/RegistryClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ struct OCIClientTests: ~Copyable {
)
)
do {
_ = try await client.resolve(name: "conatinerization/not-exists", tag: "foo")
_ = try await client.resolve(name: "containerization/not-exists", tag: "foo")
} catch {
#expect(counter.withLock { $0 } <= 3)
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/make-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ if [ ! -z "$2" ] ; then
opts+=("--hosting-base-path" "$2")
fi

/usr/bin/swift package ${opts[@]}
"$(command -v swift)" package "${opts[@]}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this change?


echo '{}' > "$1/theme-settings.json"