Skip to content
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

feature/improvements #370

Merged
merged 12 commits into from
Apr 25, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ root_url: https://techprimate.github.io/TPPDF/
module: TPPDF
output: docs
theme: fullwidth
xcodebuild_arguments: [-project, 'Example iOS-SwiftPM/Example.xcodeproj', -scheme, 'Example', -sdk, 'iphonesimulator']
xcodebuild_arguments:
[
-workspace,
"Examples.xcworkspace",
-scheme,
"Example iOS (SPM)",
-sdk,
"iphonesimulator",
]
85 changes: 85 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
--acronyms ID,URL,UUID
--allman false
--anonymousforeach convert
--assetliterals visual-width
--asynccapturing
--beforemarks
--binarygrouping 4,8
--categorymark "MARK: %c"
--classthreshold 0
--closingparen balanced
--closurevoid remove
--commas always
--conflictmarkers reject
--decimalgrouping 3,6
--elseposition same-line
--emptybraces no-space
--enumnamespaces always
--enumthreshold 0
--exponentcase lowercase
--exponentgrouping disabled
--extensionacl on-extension
--extensionlength 0
--extensionmark "MARK: - %t + %c"
--fractiongrouping disabled
--fragment false
--funcattributes preserve
--generictypes
--groupedextension "MARK: %c"
--guardelse auto
--header ignore
--hexgrouping 4,8
--hexliteralcase uppercase
--ifdef indent
--importgrouping alpha
--indent 4
--indentcase false
--indentstrings false
--lifecycle
--lineaftermarks true
--linebreaks lf
--markcategories true
--markextensions always
--marktypes never
--maxwidth none
--modifierorder
--nevertrailing
--nospaceoperators
--nowrapoperators
--octalgrouping 4,8
--onelineforeach ignore
--operatorfunc spaced
--organizetypes actor,class,enum,struct
--patternlet hoist
--ranges no-space
--redundanttype infer-locals-only
--self init-only
--selfrequired
--semicolons inline
--shortoptionals always
--smarttabs enabled
--someany true
--stripunusedargs always
--structthreshold 0
--tabwidth unspecified
--throwcapturing
--trailingclosures
--trimwhitespace always
--typeattributes preserve
--typeblanklines remove
--typemark "MARK: - %t"
--varattributes preserve
--voidtype void
--wraparguments preserve
--wrapcollections preserve
--wrapconditions preserve
--wrapeffects preserve
--wrapenumcases always
--wrapparameters preserve
--wrapreturntype preserve
--wrapternary default
--wraptypealiases preserve
--xcodeindentation enabled
--yodaswap always
--disable blankLineAfterImports,blankLinesBetweenChainedFunctions,wrapMultilineStatementBraces
--enable isEmpty,markTypes
27 changes: 14 additions & 13 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
disabled_rules:
- large_tuple
- todo
- inclusive_language
excluded:
- Carthage
- Pods
Expand All @@ -14,8 +15,6 @@ opt_in_rules:
- convenience_type
- empty_count
- empty_string
- explicit_acl
- explicit_self
- file_header
- first_where
- last_where
Expand All @@ -29,30 +28,32 @@ opt_in_rules:
- multiline_function_chains
- redundant_nil_coalescing
- static_operator
analyzer_rules:
- explicit_self
file_length:
error: 1200
warning: 500
force_cast: warning
error: 1200
warning: 500
force_cast: warning
force_try:
severity: warning
severity: warning
identifier_name:
excluded:
- id
- x
- y
- i
min_length:
error: 2
warning: 2
error: 2
warning: 2
included:
- Source
line_length: 150
reporter: xcode
line_length: 150
reporter: xcode
type_body_length:
- 300
- 400
type_name:
max_length:
error: 60
warning: 50
min_length: 2
error: 60
warning: 50
min_length: 2
14 changes: 7 additions & 7 deletions Dangerfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ let sourceChanges = allSourceFiles.contains { $0.hasPrefix("Source") }
let isNotTrivial = !danger.github.pullRequest.title.contains("#trivial")
if isNotTrivial && noChangelogEntry && sourceChanges {
danger.warn("""
Any changes to library code should be reflected in the Changelog.
Please consider adding a note there.
""")
Any changes to library code should be reflected in the Changelog.
Please consider adding a note there.
""")
}

// Make it more obvious that a PR is a work in progress and shouldn't be merged yet
Expand All @@ -30,18 +30,18 @@ if (danger.github.pullRequest.additions ?? 0) > 500 {
let addedSwiftLibraryFiles = danger.git.createdFiles.contains { $0.fileType == .swift && $0.hasPrefix("Source") }
let deletedSwiftLibraryFiles = danger.git.deletedFiles.contains { $0.fileType == .swift && $0.hasPrefix("Source") }
let modifiedCarthageXcodeProject = danger.git.modifiedFiles.contains { $0.contains("TPPDF.xcodeproj") }
if (addedSwiftLibraryFiles || deletedSwiftLibraryFiles) && !modifiedCarthageXcodeProject {
if addedSwiftLibraryFiles || deletedSwiftLibraryFiles, !modifiedCarthageXcodeProject {
fail("Added or removed library files require the Carthage Xcode project to be updated.")
}

// Warning message for not updated package manifest(s)
let manifests = [
"TPPDF.podspec",
"Package.swift",
"Package.resolved"
"Package.resolved",
]
let updatedManifests = manifests.filter { manifest in danger.git.modifiedFiles.contains { $0.name == manifest } }
if !updatedManifests.isEmpty && updatedManifests.count != manifests.count {
if !updatedManifests.isEmpty, updatedManifests.count != manifests.count {
let notUpdatedManifests = manifests.filter { !updatedManifests.contains($0) }
let updatedArticle = updatedManifests.count == 1 ? "The " : ""
let updatedVerb = updatedManifests.count == 1 ? "was" : "were"
Expand All @@ -54,7 +54,7 @@ if !updatedManifests.isEmpty && updatedManifests.count != manifests.count {

// Warn when library files has been updated but not tests.
let testsUpdated = danger.git.modifiedFiles.contains { $0.hasPrefix("Tests") }
if sourceChanges && !testsUpdated {
if sourceChanges, !testsUpdated {
warn("The library files were changed, but the tests remained unmodified. Consider updating or adding to the tests to match the library changes.")
}

Expand Down
2 changes: 1 addition & 1 deletion Documentation/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ Also each cell can have a `margin` which is the distance between the cell frame
document.add(table: table)
```

## Multi-Column Sections
### Multi-Column Sections

A multi-column section is a nested container. You create the section with an amount of columns and their relative width, add objects to each column and then add the whole section to the document.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
607FACD01AFB9204008FA782 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD01AFB9204008FA782 /* Example_iOS-Carthage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example_iOS-Carthage.app"; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -110,7 +110,7 @@
607FACD11AFB9204008FA782 /* Products */ = {
isa = PBXGroup;
children = (
607FACD01AFB9204008FA782 /* Example.app */,
607FACD01AFB9204008FA782 /* Example_iOS-Carthage.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -246,9 +246,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
607FACCF1AFB9204008FA782 /* Example */ = {
607FACCF1AFB9204008FA782 /* Example_iOS-Carthage */ = {
isa = PBXNativeTarget;
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Example" */;
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Example_iOS-Carthage" */;
buildPhases = (
607FACCC1AFB9204008FA782 /* Sources */,
607FACCD1AFB9204008FA782 /* Frameworks */,
Expand All @@ -259,11 +259,11 @@
);
dependencies = (
);
name = Example;
name = "Example_iOS-Carthage";
packageProductDependencies = (
);
productName = TPPDF;
productReference = 607FACD01AFB9204008FA782 /* Example.app */;
productReference = 607FACD01AFB9204008FA782 /* Example_iOS-Carthage.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand All @@ -283,7 +283,7 @@
};
};
};
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Example" */;
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Example_iOS-Carthage" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -298,7 +298,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
607FACCF1AFB9204008FA782 /* Example */,
607FACCF1AFB9204008FA782 /* Example_iOS-Carthage */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -559,7 +559,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Example" */ = {
607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Example_iOS-Carthage" */ = {
isa = XCConfigurationList;
buildConfigurations = (
607FACED1AFB9204008FA782 /* Debug */,
Expand All @@ -568,7 +568,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Example" */ = {
607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Example_iOS-Carthage" */ = {
isa = XCConfigurationList;
buildConfigurations = (
607FACF01AFB9204008FA782 /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
BuildableName = "Example_iOS-Carthage.app"
BlueprintName = "Example_iOS-Carthage"
ReferencedContainer = "container:Example_iOS-Carthage.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand Down Expand Up @@ -45,9 +45,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
BuildableName = "Example_iOS-Carthage.app"
BlueprintName = "Example_iOS-Carthage"
ReferencedContainer = "container:Example_iOS-Carthage.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
Expand All @@ -62,9 +62,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "Example.app"
BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj">
BuildableName = "Example_iOS-Carthage.app"
BlueprintName = "Example_iOS-Carthage"
ReferencedContainer = "container:Example_iOS-Carthage.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down