-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding project files * Refactoring and revision of the entire API Also adding example and updating tests * Revised API and readme file * Adding builders for state machine, state, and event
- Loading branch information
Showing
30 changed files
with
2,150 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Preflight Code Checks | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
Preflight-Code-Checks: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check for Changes | ||
id: repo-fetch-changes | ||
run: | | ||
echo "-> Source: ${{ github.head_ref }} (${{ github.event.pull_request.head.sha }})" | ||
echo "-> Target: ${{ github.base_ref }} (${{ github.event.pull_request.base.sha }})" | ||
# Fetching base ref | ||
git fetch --prune --no-tags --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/heads/${{ github.base_ref }} | ||
against=${{ github.event.pull_request.base.sha }} | ||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | ||
echo "changed_files<<$EOF" >> $GITHUB_ENV | ||
changed_files=$(git --no-pager diff-index --cached --diff-filter=ACMR --name-only --relative $against -- '*.swift') | ||
echo "$changed_files" >> $GITHUB_ENV | ||
echo "$EOF" >> $GITHUB_ENV | ||
- name: Code Format Validation | ||
if: env.changed_files != '' | ||
run: | | ||
modified_file_list="${{ github.workspace }}/modified_file_list" | ||
echo "${{ env.changed_files }}" > $modified_file_list | ||
swiftformat --filelist "$modified_file_list" --lint --config .swiftformat --swiftversion 5 --reporter github-actions-log | ||
- name: Linting Code | ||
if: env.changed_files != '' | ||
run: | | ||
modified_files=$(cat "${{ github.workspace }}/modified_file_list") | ||
swiftlint lint --config .swiftlint --reporter "github-actions-logging" $modified_files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
--exclude Tests, Scripts, Documentation | ||
# format options | ||
|
||
--exclude DerivedData, Documentation, Scripts, **/Package.swift | ||
|
||
--disable redundantType | ||
|
||
--indent 4 | ||
--allman true | ||
--semicolons never | ||
--wraparguments after-first | ||
--elseposition next-line | ||
--indentcase true | ||
--patternlet inline | ||
--semicolons never | ||
--shortoptionals always | ||
--stripunusedargs always | ||
--trimwhitespace always | ||
--wraparguments before-first | ||
--wrapcollections before-first | ||
--elseposition next-line | ||
--patternlet inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,104 @@ | ||
excluded: | ||
- Tests | ||
- DerivedData | ||
- Documentation | ||
- Scripts | ||
|
||
disabled_rules: | ||
- colon | ||
- opening_brace | ||
- trailing_comma | ||
- closing_brace | ||
- statement_position | ||
- discarded_notification_center_observer | ||
- switch_case_alignment | ||
- identifier_name | ||
- unused_setter_value | ||
- multiple_closures_with_trailing_closure | ||
|
||
opt_in_rules: | ||
- private_outlet | ||
- private_action | ||
- anyobject_protocol | ||
- collection_alignment | ||
- convenience_type | ||
- discouraged_object_literal | ||
- discouraged_optional_collection | ||
- force_unwrapping | ||
- fatal_error_message | ||
- fallthrough | ||
- empty_string | ||
- contains_over_first_not_nil | ||
- empty_count | ||
- empty_string | ||
- fallthrough | ||
- fatal_error_message | ||
- first_where | ||
- force_unwrapping | ||
- private_action | ||
- private_outlet | ||
- sorted_imports | ||
|
||
line_length: 150 | ||
analyzer_rules: | ||
- unused_import | ||
|
||
void_function_in_ternary: | ||
severity: error | ||
first_where: | ||
severity: error | ||
force_unwrapping: | ||
severity: error | ||
private_outlet: | ||
severity: error | ||
private_action: | ||
severity: error | ||
multiple_closures_with_trailing_closure: | ||
severity: error | ||
notification_center_detachment: | ||
severity: error | ||
empty_enum_arguments: | ||
severity: error | ||
empty_parentheses_with_trailing_closure: | ||
severity: error | ||
redundant_objc_attribute: | ||
severity: error | ||
fatal_error_message: | ||
severity: error | ||
fallthrough: | ||
severity: error | ||
empty_string: | ||
severity: error | ||
empty_count: | ||
severity: error | ||
return_arrow_whitespace: | ||
severity: error | ||
vertical_parameter_alignment: | ||
severity: error | ||
trailing_whitespace: | ||
severity: error | ||
vertical_whitespace: | ||
severity: error | ||
|
||
nesting: | ||
type_level: 2 | ||
|
||
function_parameter_count: | ||
warning: 4 | ||
error: 5 | ||
ignores_default_parameters: false | ||
|
||
file_length: | ||
warning: 450 | ||
error: 500 | ||
warning: 500 | ||
error: 600 | ||
|
||
line_length: | ||
warning: 170 | ||
error: 180 | ||
ignores_comments: true | ||
|
||
type_body_length: | ||
warning: 300 | ||
warning: 250 | ||
error: 400 | ||
|
||
closure_body_length: | ||
warning: 80 | ||
error: 100 | ||
type_name: | ||
allowed_symbols: ["_"] | ||
max_length: | ||
warning: 50 | ||
error: 60 | ||
|
||
identifier_name: | ||
allowed_symbols: ["_"] | ||
excluded: ["id", "iv", "ok"] | ||
severity: error | ||
|
||
function_body_length: | ||
warning: 100 | ||
error: 110 | ||
|
||
cyclomatic_complexity: | ||
warning: 10 | ||
error: 20 | ||
|
||
reporter: "xcode" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.