Skip to content

Contributing

Alex edited this page Jun 12, 2023 · 7 revisions

Issues, Bugs, Feature or Component Requests

Currently we aren't accepting issues from people outside the Adevinta Platform to this repo, but you're always welcome to the discussions page.

If you're part of the Adevinta Platform

Requirements

Latest Xcode installed on your machine

xcodegen

Run xcodegen inn project repository and .xcproj file would be generated.

Pull Requests

The best way to make an impact is by creating code submissions called pull requests. Pull requests should be a solution to Github issues.

To make a pull request:

  1. Make sure there’s a GitHub issue for the change you’re proposing.
  2. Fork the repo for the platform your code works in.
  3. Write code in your fork, on a branch if you plan to make multiple changes.
  4. Create a pull request to merge your branch’s contributions into the corresponding Spark repo.
  5. The pull request will be triaged by a #spark-dev member and code reviewed by #spark-contributors-ios member.
  6. If the pull request is accepted, the accepting #spark-dev member will merge the pull request for you.

What if I already made a pull request but want to add more commits?

If you correctly created a new branch for your changes, you can simply upload the new commits to your fork and they will automatically appear in the PR.

Testing

Code should be covered by tests

Mocking

For mocking we are using sourcery. This tool creates mocks for our protocols you've marked with // sourcery: AutoMockable.

For example:

// sourcery: AutoMockable

protocol YourProtocolName {

func yourFunc()

}

Running sourcery will create class YorProtocolGeneratedMock: YourProtocolName which could be used in testing.

To do so, just run sourcery command in root of the project.

Snapshot Testing

If you introduce visible changes, you'll likely have to update screenshots files for the tests to pass. For snapshot testing we are using a sub-directory spark-ios-snapshots.

You should create the same branch in snapshots git repository (e.g. feature/component/componentname in spark-ios and spark-ios-snapshots. The PR will then use the snapshots from this branch while executing the tests.

If there are no available snapshots for your component, running snapshots tests for the first time will create them in subdirectory spark-ios-snapshots of spark-ios with the name of component.

Documentation writing

Here you will find a template to write documentation for component. Please follow it.

# <Name of the component>

## Usage: 
If component is available in different implementation and/or interface toolkits (UIKit/SwiftUI), could you please divide usage?
In case if component has the same init and default properties for different toolkits — feel free to merge them into one section.

### <ComponentUIView>
Parameters: here you could list parameters required for initialization.

Default values: here you could provide parameters that are set by default and not listed in init method.

Modifiers: here you could list modifiers available for view to edit default parameters if applicable.

### <ComponentView>
Parameters: here you could list parameters required for initialization.

Default values: here you could provide parameters that are set by default and not listed in init method.

Modifiers: here you could list modifiers available for view to edit default parameters if applicable.

### <ComponentUIGroupView>
Parameters: here you could list parameters required for initialization.

Default values: here you could provide parameters that are set by default and not listed in init method.

Modifiers: here you could list modifiers available for view to edit default parameters if applicable.

### <ComponentGroupView>
Parameters: here you could list parameters required for initialization.

Default values: here you could provide parameters that are set by default and not listed in init method.

Modifiers: here you could list modifiers available for view to edit default parameters if applicable.

## Examples
### <ComponentUIView>

<Code snippet of usage>

### <ComponentView>

<Code snippet of usage>

### <ComponentUIGroupView>

<Code snippet of usage>