Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavyaroslav committed Mar 3, 2023
2 parents cc076ee + 8cb9a20 commit 2ddcaad
Show file tree
Hide file tree
Showing 119 changed files with 11,200 additions and 11,291 deletions.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
count = True
ignore-words-list = ans,deriver,inout,packag
skip = *.js,*WordLists.swift,.git,Carthage,.build,build
10 changes: 8 additions & 2 deletions .github/workflows/macOS-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
spm:
name: Swift Package Manager 5.7
runs-on: macOS-12
concurrency:
concurrency:
group: spm-${{ github.run_id }}
cancel-in-progress: false
steps:
Expand All @@ -38,7 +38,13 @@ jobs:
run: |
pip3 install --upgrade pip
pip3 install codespell
codespell --count --ignore-words-list=ans,deriver,inout,packag --skip="*.js,*WordLists.swift"
codespell # See .codespellrc for args
- name: SwiftLint
run: |
# 1. Make all automated fixes that are possible
# 2. git diff to see what (if any) automated fixes were made
# 3. See https://github.com/realm/SwiftLint#xcode explains why the double run
swiftlint --fix --quiet && git diff && swiftlint --quiet
- name: Resolve dependencies
run: swift package resolve
- name: Build
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://pre-commit.com
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file.
# Using pre-commit.ci is even better than using GitHub Actions for pre-commit.
name: pre-commit
on:
pull_request:
branches: [develop]
push:
branches: [develop]
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install pre-commit
- run: pre-commit --version
- run: pre-commit install
- run: pre-commit run --all-files
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch, staging, --branch, main, --branch, master, --branch, develop-4.0, --branch, develop-upstream]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell # See .codespellrc for args
# - repo: https://github.com/realm/SwiftLint # Too slow in pre-commit
# rev: 0.50.3
# hooks:
# - id: swiftlint
# args: [--fix, Sources, Tests]
82 changes: 55 additions & 27 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,73 @@
excluded:
- Carthage
- Pods
- .build
- Build
- Carthage
- DerivedData
- Pods

analyzer_rules:
- unused_import

disabled_rules:
- type_name
- block_based_kvo
- closure_body_length
- computed_accessors_order
- cyclomatic_complexity
- duplicate_imports
- empty_enum_arguments
- empty_string
- file_length
- for_where
- force_cast
- force_try
- force_unwrapping
- function_body_length
- function_parameter_count
- identifier_name
- implicit_getter
- implicitly_unwrapped_optional
- indentation_width
- large_tuple
- legacy_objc_type
- line_length
- multiple_closures_with_trailing_closure
- nesting
- orphaned_doc_comment
- operator_whitespace
- return_arrow_whitespace
- shorthand_operator
- todo
- trailing_closure
- type_body_length
- type_name
- unneeded_break_in_switch
- unused_optional_binding
- vertical_parameter_alignment
- xctfail_message

opt_in_rules:
- weak_delegate
- unused_import
- unneeded_parentheses_in_closure_argument
- trailing_closure
- static_operator
- redundant_nil_coalescing
- override_in_extension
- legacy_objc_type
- implicitly_unwrapped_optional
- force_unwrapping
- empty_string
- closure_body_length
- fallthrough
- indentation_width

# force warnings
force_cast: error
force_try: error
- closure_body_length
- empty_string
- fallthrough
- force_unwrapping
- implicitly_unwrapped_optional
- indentation_width
- legacy_objc_type
- override_in_extension
- redundant_nil_coalescing
- static_operator
- trailing_closure
- unneeded_parentheses_in_closure_argument
- weak_delegate

custom_rules:
commented_out_code:
included: ".*\\.swift" # regex that defines paths to include during linting. optional.
excluded: ".*Test(s)?\\.swift" # regex that defines paths to exclude during linting. optional
name: "Commented out code" # rule name. optional.
regex: "^\\/\\/\\s*(@|\\.?([a-z]|(\\})))" # matching pattern
commented_out_code:
included: .*\.swift # regex that defines paths to include during linting. optional.
excluded: .*Test(s)?\.swift # regex that defines paths to exclude during linting. optional
name: Commented out code # rule name. optional.
regex: ^\s*(\/\/(?!\s*swiftlint:).*|\/\*[\s\S]*?\*\/) # matching pattern
capture_group: 0 # number of regex capture group to highlight the rule violation at. optional.
match_kinds: # SyntaxKinds to match. optional.
- comment
message: "No commented code in devel branch allowed." # violation message. optional.
message: No commented code in devel branch allowed. # violation message. optional.
severity: warning # violation severity. optional.
4 changes: 2 additions & 2 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Please take it from the [roadmap](https://hackmd.io/G5znP3xAQY-BVc1X8Y1jSg) or f
## Codestyle guideline
- `swiftlint` check should goes with no warnings.
- Here’s some more detailed and human readable code style [guidelines](https://hackmd.io/8bACoAnTSsKc55Os596yCg "") (you can add there some suggestion if you’d like to).
- Here’s some more detailed and human readable code style [guidelines](https://hackmd.io/8bACoAnTSsKc55Os596yCg "") (you can add there some suggestion if you’d like to).
- We use [swift](https://www.swift.org/documentation/api-design-guidelines/ "") name convention.
## Tests guideline
1. Cover each new public method with tests.
Expand Down Expand Up @@ -67,4 +67,4 @@ on:
- [ ] All public method have `///` styled comments.
- [ ] All magic or nonintuitive internal code parts are clearly explained in inline comments.
- [ ] `swiftlint` ran have no warnings.
- [ ] No commented out code lefts in PR.
- [ ] No commented out code lefts in PR.
30 changes: 0 additions & 30 deletions Example/myWeb3Wallet/Podfile

This file was deleted.

53 changes: 0 additions & 53 deletions Example/myWeb3Wallet/Podfile.lock

This file was deleted.

Loading

0 comments on commit 2ddcaad

Please sign in to comment.