Skip to content

Latest commit

 

History

History
258 lines (187 loc) · 13.6 KB

CONTRIBUTING.md

File metadata and controls

258 lines (187 loc) · 13.6 KB

Contributing to Decentproof

First off, thanks for taking the time to contribute! ❤️

All types of contributions are encouraged and valued. See the Table of Contents for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉

And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:

  • Star the project
  • Share it on social media
  • Refer this project in your project's readme
  • Mention the project at local meetups and tell your friends/colleagues

Table of Contents

Code of Conduct

This project and everyone participating in it is governed by the Decentproof Code of Conduct. By participating, you are expected to uphold this code!

I Have a Question

If you want to ask a question, we assume that you have read the available Documentation.

Before you ask a question, it is best to search for existing Discussions that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.

If you then still feel the need to ask a question and need clarification, I recommend the following:

  • Navigate to Discussions
  • Create a new Discussion
  • Decide on short, fitting title
  • Write your question

I will try to reply to it.

Please don't open an issue if it's not related to implementation (code, design, bugs etc.). If you are not sure, just choose what you think is right.

I Want To Contribute

Legal Notice

When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.

Reporting Bugs

Before Submitting a Bug Report

A good bug report shouldn't leave others needing to chase you up for more information. Therefore, I ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.

  • Make sure that you are using the latest version.
  • Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the documentation. If you are looking for support, you might want to check this section).
  • To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the bug tracker.
  • Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
  • Collect information about the bug:
  • Stack trace (Traceback)
  • OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
  • Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
  • Possibly your input and the output
  • Can you reliably reproduce the issue? And can you also reproduce it with older versions?

How Do I Submit a Good Bug Report?

Sensitive or Security related issues should use the dedicated template in the issue tracker or via E-Mail me at: flajt[at]protonmail[dot]com

We use GitHub issues to track bugs and errors. If you run into an issue with the project:

  • Open an Issue.
  • Try to find the best possible lables for it
  • Explain the behavior you would expect and the actual behavior.
  • Please provide as much context as possible and describe the reproduction steps that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
  • Provide the information you collected in the previous section.

Once it's filed:

  • I will label the issue accordingly if required.
  • I will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as more-info-required.
  • If I can reproduce it, I will assign a prio label to it and it will get implemented by someone.

Suggesting Enhancements

This section guides you through submitting an enhancement suggestion for Decentproof, including completely new features and minor improvements to existing functionality. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.

Before Submitting an Enhancement

  • Make sure that you are using the latest version.
  • Read the documentation carefully and find out if the functionality is already covered, maybe by an individual configuration.
  • Perform a search to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
  • Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.

How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as GitHub issues.

  • Use a clear and descriptive title for the issue to identify the suggestion.
  • Provide a step-by-step description of the suggested enhancement in as many details as possible.
  • Describe the current behavior and explain which behavior you expected to see instead and why. At this point you can also tell which alternatives do not work for you.
  • You may want to include screenshots and animated GIFs which help you demonstrate the steps or point out the part which the suggestion is related to. You can use this tool to record GIFs on macOS and Windows, and this tool or this tool on Linux.
  • Explain why this enhancement would be useful to most Decentproof users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
  • If you are not sure yet, you can also open a discussion to gather additional input

Adding Translations

I've decided to use inlang for translation (mainly because it's the first service I've stumbled across)

  • To add you can simply go to the README.md and click on the translation status image
  • From there you will be redirected to the online editor
  • You can sign in with your github account and start editing
  • You might need to open a second PR in case the language is not yet supported by the app and add the local definition under main.dart (you just need to add a Local("your-lang-code-here") to the other ones like Locale("de") etc.) #TODO: Update section after testing

Your First Code Contribution

  1. Select an issue you think you can manage (if you are a unsure I will try to add good-first-issue tags, these should be easy to do)
  2. Just request if you can handle it
  3. Follow the setup instructions in the README file
  4. Create yourself a branch, you can either do it by creating it directly from the issue or name it as close as you can to the issue title
  5. Start working on it
  6. If you are done, add some tests. If it would require E2E testing or native functionality mock it the best you can.
  7. Open a PR
  8. Wait for someone (me) to review your PR and merge it
  9. Congrats, your PR has been successfully merged

If you are unsure feel free to ask questions under the issue.

Improving The Documentation

  1. If there is not an existing issue for what you want to change, open it up (if you are unsure consider opening a discussion to gather insides)
  2. Label yourself accordingly
  3. Wait for me to respond
  4. If I give you the thumbs up, you can start working on it, just create a branch and you are good to go.
  5. Open a PR against dev
  6. Wait for me to review and merge it
  7. Congrats, your PR was successfully merged

"Style Guide"

Some tips on how to write project fitting code. If you find something missing or odd, please, open a discussion.

Caseing

  • UpperCamelCase is the way in this project, from file names to classes
  • lowerCamelCase should be used functions and methods and folders

Naming

  • XXXXWrapper for anything that just wraps a package / native interface
  • XXXXService for any logic related stuff (might need some more speration at some point, thoughts are welcome)
  • XXXPage.dart for any page files
  • IXXXS for interfaces

Folders

  • util for utility
  • logic for services
  • uiblocks for widgets
  • bloc or xxxBloc for BLOCs
  • shared for any shared code (only under lib)

BLOCs

Have a look at this: https://bloclibrary.dev/#/blocnamingconventions, ideally everything should be named like this. (I guess)

Structure

This project attempts a feature based structure, you create a top level folder featureName followed by the folders you need see Folders for more information.

Interfaces

Nearly all classes have interface, so make sure yours do as well. This is used for dependency injection via get_it if required.

Dependency Injection

If you want to use a class in any other class please use dependecy injection with get_it.

Register a dependency

To register a class go to register.dart and register by using getIt.registerFactory<MyInterface>(()=>MyClass()) if you are not sure check the file for the most common use cases

Using depencies

  • Create a get_it instance
  • Use it to retrive class E.g.
final getIt = GetIt.I;

final myClass = getIt.get<MyInterface>();
await myClass.myFunction(my-paramerterA, my-parameterB);

Where To Use Services

Services should used in BLOCs, or other Services, which ideally are used by a BLOC.

BLOCs should be the thing between our Widgets and our Services! If there is a dozen Services running in a BLOC, you can consider wrapping it in a Special Service, if you want to do that please open a discussion and tag me so we can find a propper naming convention for that.

Idealy a feature looks like this:
-----> = Implemented By
Services can of course implement multiple Wrappers and other services if desired, however try to keep it resonable.

PackageServiceWrapper ------> MyFeatureService ----> My Feature Bloc

When To Create

Here you can check what you need to create for certain operations.

Wrappers

If you need to abstract a over a package or native logic? Create a wrapper Examples:

Services

A specific feature or subfeature requires logic? Create a Service! (don't forget the interface) Examples:

BLOCs

You need to change state? Use a BLOC Examples:

Attribution

This guide is based on the contributing-gen. Make your own! It has been modified to fit the project.