Updating Github templates (#616)

This commit is contained in:
Jochum van der Ploeg
2021-02-22 21:59:40 +01:00
committed by GitHub
parent bde4585fa0
commit 3078a7a4fd
16 changed files with 297 additions and 115 deletions

46
.github/ISSUE_TEMPLATE/1_bug.md vendored Normal file
View File

@ -0,0 +1,46 @@
---
name: Bug report.
about: You are creating a Game with Flame but you are noticing some strange behaviour, that it throws an unexpected exception, or that it is not working according to the specifications.
title: ''
labels: 'bug'
assignees: ''
---
<!-- When reporting a bug, please read this complete template and fill all the questions in order to get a better response -->
# Current bug behaviour
<!-- What is the current behaviour that you see? -->
# Expected behaviour
<!-- What behaviour did you expect? -->
# Steps to reproduce
<!-- This one is very important, please be very precise in how we can reproduce this bug -->
<!-- If possible please report steps based on the example from this plugin! -->
# Flutter doctor output
<!-- Execute in a terminal and put output into code block below -->
```
Output of: flutter doctor -v
```
# More environment information
<!--
Create a list of more environment information, like:
* Flame version: 1.0.0
* Platform affected: android, ios, web
* Platform version affected: android 9, ios 13
-->
# Log information
<!-- If you have any debug / error logging, please fill it here within the code block below -->
```
Enter log information in this code block
```
# More information
<!-- Do you have any other useful information about this bug report? Please write it down here -->
<!-- Possible helpful information: references to other sites/repositories -->
<!-- Are you interested in working on a PR for this? >

21
.github/ISSUE_TEMPLATE/2_feature.md vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: Feature request.
about: Suggest a new feature for Flame.
title: ''
labels: 'enhancement'
assignees: ''
---
<!-- When reporting a feature, please read this complete template and fill all the questions in order to get a better response -->
# Problem to solve
<!-- Which problem would be solved with this feature? -->
# Proposal
<!-- What do you propose as a solution? Add as much information as you can! -->
# More information
<!-- Do you have any other useful information about this feature report? Please write it down here -->
<!-- Possible helpful information: references to other sites/repositories -->
<!-- Are you interested in working on a PR for this? >

24
.github/ISSUE_TEMPLATE/3_improvement.md vendored Normal file
View File

@ -0,0 +1,24 @@
---
name: Improvement suggestion.
about: Something in Flame can be improved.
title: ''
labels: 'enhancement'
assignees: ''
---
<!-- When reporting a improvement, please read this complete template and fill all the questions in order to get a better response -->
# What could be improved
<!-- What part of the code/functionality could be improved? -->
# Why should this be improved
<!-- Why is this necessary to be improved? -->
# Any risks?
<!-- Are there any risks in improving this? Will the API change? Will other functionality change? -->
# More information
<!-- Do you have any other useful information about this improvement report? Please write it down here -->
<!-- Possible helpful information: references to other sites/repositories -->
<!-- Are you interested in working on a PR for this? >

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: I have some questions about Flame.
url: https://stackoverflow.com/tags/flame
about: Ask your questions on StackOverflow! The community is always willing to help out.
- name: Join us on Discord!
url: https://discord.gg/pxrBmy4
about: Ask your questions in our community!

View File

@ -1,37 +0,0 @@
<!---
Please use this template to fill in your issue. Issues that does not
follow this will be asked to be edited to match the template, or will be closed
We use Github issues for problem/bug reports, for questions please use the Discord channel
The link for the Discord channel can be found on the project README
-->
## Description
Describe your issue here
## Development environment
Flame version:
<!--
NOTE: Flame supports the stable and beta Flutter channels. Issues outside of those channels may not be prioritized, or closed.
-->
Flutter doctor:
```
Include your flutter doctor output here
```
## Runtime
This issue is related to running on which platform? (Select all that apply)
- [ ] Android :android:
- [ ] iOS :apple:
- [ ] Web :browser:
## Minimal reproducible code (Required for bugs)
Include a minimal code that reproduces the problem add it inline using code block markdown, or a link to Github repository:

View File

@ -1,25 +1,37 @@
# Description
## Description
Please include a summary of the change.
*Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this MR is changing it, and what motivated the change. If this is a breaking change, specify explicitly which APIs have been changed*
Fixes # (issue number, if there is one)
## Checklist
## Type of change
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth and quick review process.
Please delete options that are not relevant.
- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [ ] My PR includes unit or integration tests for *all* changed/updated/fixed behaviors (See [Contributor Guide]).
- [ ] All existing and new tests are passing.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] The Flame analyzer (`./scripts/analyze.sh`) does not report any problems on my PR.
- [ ] I have added examples for new features in `doc/examples`.
- [ ] I have formatted my code with `./scripts/format.sh`.
- [ ] I read and followed the [Flutter Style Guide].
- [ ] I have added a description of the change under `[next]` in `CHANGELOG.md`.
- [ ] I am willing to follow-up on review comments in a timely manner.
- [ ] I am happy with the current version of this PR and it is ready to be reviewd
- [ ] I removed the `Draft` status, by clicking on the `Ready for review` button in this PR.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
## Breaking Change
## Checklist:
Does your PR require Flame users to manually update their apps to accommodate your change?
If something is unclear, please submit the PR anyways and ask about what you thought was unclear.
- [ ] Yes, this is a breaking change (please indicate a breaking change in `CHANGELOG.md`).
- [ ] No, this is *not* a breaking change.
- [ ] This branch is based on the latest `master`
- [ ] I have added an entry under `[next]` in `CHANGELOG.md`
- [ ] I have formatted my code with `flutter format`
- [ ] I have made corresponding changes to the documentation
- [ ] I have added examples for new features in `doc/examples`
- [ ] The continuous integration (CI) is passing
## Related Issues
*Replace this paragraph with a list of issues related to this PR from the [issue database]. Indicate, which of these issues are resolved or fixed by this PR.*
<!-- Links -->
[issue database]: https://github.com/flame-engine/flame/issues
[Contributor Guide]: https://github.com/flame-engine/flame/blob/master/CONTRIBUTING.md
[Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[pub versioning philosophy]: https://www.dartlang.org/tools/pub/versioning

64
.github/workflows/cicd.yml vendored Normal file
View File

@ -0,0 +1,64 @@
name: cicd
on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
jobs:
# BEGIN LINTING STAGE
dartdoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
- run: flutter pub get
- run: ./scripts/dartdoc.sh
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
- run: ./scripts/format.sh
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
- run: ./scripts/analyze.sh
# END LINTING STAGE
# BEGIN TESTING STAGE
test:
needs: [dartdoc, format, analyze]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
- run: flutter pub get
- run: flutter test
# END TESTING STAGE

View File

@ -1,27 +0,0 @@
name: Test
on:
push:
branches:
- master
- master-v0.x
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
- run: git clean -xffd # https://github.com/dart-lang/sdk/issues/39792
- run: flutter --version
- run: flutter pub get
- run: ./scripts/lint.sh
- run: flutter test

56
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,56 @@
# Contributing Guidelines
If you're interested in contributing to this project, here are a few ways to do so:
**Note:** If these contributing guidelines are not followed we will close the issue or PR, please read these instructions carefully.
## Bug fixes
* If you find a bug, please first report it using [Github issues](https://github.com/flame-engine/flame/issues/new).
* First check if there is not already an issue for it; duplicated issues will be closed.
* Issues that have already been identified as a bug will be labelled "bug".
* If you'd like to submit a fix for a bug, send a [Pull Request](https://guides.github.com/activities/forking/#making-a-pull-request) from your own fork, also read the [How To](#how-to) and [Development Guidelines](#development-guidelines).
* Include a test that isolates the bug and verifies that it was fixed.
* Also update the examples and documentation if necessary.
## New Features
* If you'd like to add a feature to the library that doesn't already exist, feel free to describe the feature in a new [Github issues](https://github.com/flame-engine/flame/issues/new).
* You can also join us on [Discord](https://discord.gg/pxrBmy4) to discuss some initials thoughts.
* Issues that have been identified as a feature request will be labelled "enchanment".
* If you'd like to implement the new feature, please wait for feedback from the project maintainers before spending too much time writing the code. In some cases, enhancements may not align well with the project objectives at the time.
* Implement your code and please read the [How To](#how-to) and [Development Guidelines](#development-guidelines).
* Also update the examples and documentation where needed.
## Documentation & Miscellaneous
* If you think the documentation could be clearer or an example should be added, or you have an alternative implementation of something that may have more advantages, we would love to hear it.
* As always first file a report in a [Github issues](https://github.com/flame-engine/flame/issues/new).
* Issues that have been identified as a documentation change will be labelled "documentation".
* Implement the changes to the documentation, please read the [How To](#how-to) and [Development Guidelines](#development-guidelines).
# Requirements
For a contribution to be accepted:
* Take note of the [Development Guidelines](#development-guidelines)
* Code must follow existing styling conventions
* Commit message should start with a [issue number](#how-to) and should also be descriptive.
If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the issue. You can still continue to add more commits to the branch you have sent the Pull Request from.
# How To Contribute
* First of all [file an bug or feature report](https://github.com/flame-engine/flame/issues/new) on this repository.
* [Fork the project](https://guides.github.com/activities/forking/#fork) on Github
* Clone the forked repository to your local development machine (e.g. `git clone https://github.com/<YOUR_GITHUB_USER>/flame.git`)
* Run `flutter pub get` in the cloned repository to get all the dependencies
* Create a new local branch based on issue number from first step (e.g. `git checkout -b 12-new-feature`)
* Make your changes
* When committing your changes, make sure to start the commit message with `#<issue-number>` (e.g. `git commit -m '#12 - New Feature added'`)
* Push your new branch to your own fork into the same remote branch (e.g. `git push origin 12-new-feature`)
* On Github goto the [pull request page](https://guides.github.com/activities/forking/#making-a-pull-request) on your own fork and create a merge request to this reposistory
# Development Guidelines
* Documentation should be updated.
* Examples should be updated.
* Format the Dart code accordingly.
* Note the [`analysis_options.yaml`](https://github.com/flame-engine/flame/blob/master/analysis_options.yaml) and write code as stated in this file
# Test generating of `dartdoc`
* Run the `./scripts/dartdoc.sh` script to generate the Dart documentation.
* Output will be placed into `doc/api/`.

View File

@ -15,6 +15,7 @@ dev_dependencies:
sdk: flutter
test: ^1.9.4
dart_code_metrics: ^2.4.0
dartdoc: ^0.39.0
environment:
sdk: ">=2.7.0 <3.0.0"

27
scripts/analyze.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
flutter pub get
# We need to run pubget on all the examples
for f in $(find doc/examples -name 'pubspec.yaml'); do
d=$(dirname $f)
cd $d
flutter pub get
cd - > /dev/null
done
cd .
flutter pub get
result=$(flutter pub run dart_code_metrics:metrics .)
if [ "$result" != "" ]; then
echo "flutter dart code metrics issues: $1"
echo "$result"
exit 1
fi
result=$(flutter analyze .)
if ! echo "$result" | grep -q "No issues found!"; then
echo "$result"
echo "flutter analyze issue: $1"
fi
exit 0

View File

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash
# run this first time:
# flutter update-packages

3
scripts/dartdoc.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
flutter pub run dartdoc --no-auto-include-dependencies --quiet

8
scripts/format.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
FORMAT_ISSUES=$(flutter format --set-exit-if-changed -n .)
if [ $? -eq 1 ]; then
echo "flutter format issues on"
echo $FORMAT_ISSUES
exit 1
fi

View File

@ -1,3 +0,0 @@
#!/bin/bash -e
dartdoc

View File

@ -1,35 +1,14 @@
#!/usr/bin/env bash
FORMAT_ISSUES=$(flutter format --set-exit-if-changed -n .)
./scripts/format.sh
if [ $? -eq 1 ]; then
echo "flutter format issues on"
echo $FORMAT_ISSUES
echo "Formatting failed!"
exit 1
fi
./scripts/analyze.sh
if [ $? -eq 1 ]; then
echo "Analyzing failed!"
exit 1
fi
flutter pub get
# We need to run pubget on all the examples
for f in $(find doc/examples -name 'pubspec.yaml'); do
d=$(dirname $f)
cd $d
flutter pub get
cd - > /dev/null
done
cd .
flutter pub get
result=$(flutter pub run dart_code_metrics:metrics .)
if [ "$result" != "" ]; then
echo "flutter dart code metrics issues: $1"
echo "$result"
exit 1
fi
result=$(flutter analyze .)
if ! echo "$result" | grep -q "No issues found!"; then
echo "$result"
echo "flutter analyze issue: $1"
exit 1
fi
echo "success"
exit 0
echo "Succesfully linted!"