|
| 1 | +# Contributing Guidelines |
| 2 | + |
| 3 | +Welcome, and thanks in advance for your help! Please follow these simple guidelines :+1: |
| 4 | + |
| 5 | +# How to contribute to the Serverless Azure Plugin |
| 6 | + |
| 7 | +## When you propose a new feature or bug fix |
| 8 | + |
| 9 | +**Note:** Please make sure to write an issue first and get enough feedback before jumping into a Pull Request! |
| 10 | + |
| 11 | +- Please make sure there is an open issue discussing your contribution |
| 12 | +- If there isn't, please open an issue so we can talk about it before you invest time into the implementation |
| 13 | +- When creating an issue or pull request, follow the template that GitHub shows so that we have enough information about your request |
| 14 | + |
| 15 | +## When you want to work on an existing issue |
| 16 | + |
| 17 | +**Note:** Please write a quick comment in the corresponding issue and ask if the feature is still relevant and that you want to jump into the implementation. |
| 18 | + |
| 19 | +We will do our best to respond/review/merge your PR according to priority. We hope that you stay engaged with us during this period to insure QA. Please note that the PR will be closed if there hasn't been any activity for a long time (~ 30 days) to keep us focused and keep the repo clean. |
| 20 | + |
| 21 | +## Reviewing Pull Requests |
| 22 | + |
| 23 | +Another really useful way to contribute to Serverless is to review other peoples Pull Requests. Having feedback from multiple people is really helpful and reduces the overall time to make a final decision about the Pull Request. |
| 24 | + |
| 25 | +## Writing / improving documentation |
| 26 | + |
| 27 | +Our documentation lives on GitHub in the [docs](docs) directory. Do you see a typo or other ways to improve it? Feel free to edit it and submit a Pull Request! |
| 28 | + |
| 29 | +## Providing support |
| 30 | + |
| 31 | +The easiest thing you can do to help us move forward and make an impact on our progress is to simply provide support to other people having difficulties with their Serverless projects. |
| 32 | + |
| 33 | +You can do that by replying to [issues on Github](https://github.com/serverless/serverless-azure-functions/issues), chatting with other community members in [our Chat](http://chat.serverless.com) or helping with questions in [our Forum](http://forum.serverless.com). |
| 34 | + |
| 35 | +### Commit Message Format |
| 36 | + |
| 37 | +Each commit message consists of a **header**, a **body** and a **footer**. |
| 38 | + |
| 39 | +```text |
| 40 | +<type>: <short description> |
| 41 | +<BLANK LINE> |
| 42 | +<body> |
| 43 | +<BLANK LINE> |
| 44 | +<footer> |
| 45 | +``` |
| 46 | + |
| 47 | +### Header |
| 48 | + |
| 49 | +#### Type |
| 50 | + |
| 51 | +Must be one of the following: |
| 52 | + |
| 53 | +* **build**: Changes that affect the build system or external dependencies |
| 54 | +* **ci**: Changes to our CI configuration files and scripts |
| 55 | +* **docs**: Documentation only changes |
| 56 | +* **feat**: A new feature |
| 57 | +* **fix**: A bug fix |
| 58 | +* **perf**: A code change that improves performance |
| 59 | +* **refactor**: A code change that neither fixes a bug nor adds a feature |
| 60 | +* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| 61 | +* **test**: Adding missing tests or correcting existing tests |
| 62 | +* **chore**: Updating dependencies |
| 63 | + |
| 64 | +#### Short Description |
| 65 | + |
| 66 | +Contains a succinct description of the change: |
| 67 | + |
| 68 | +* use the imperative, present tense: "change" not "changed" nor "changes" |
| 69 | +* don't capitalize the first letter |
| 70 | +* no dot (.) at the end |
| 71 | + |
| 72 | +### Body |
| 73 | + |
| 74 | +Just as in the **short description**, use the imperative, present tense: "change" not "changed" nor "changes". |
| 75 | +The body should include the motivation for the change and contrast this with previous behavior. |
| 76 | + |
| 77 | +### Footer |
| 78 | + |
| 79 | +The footer should contain any information about **breaking changes** and is also the place to |
| 80 | +reference Azure DevOps user stories/tasks or GitHub issues that this commit **closes**. |
| 81 | + |
| 82 | +### Commit Message Example |
| 83 | + |
| 84 | +```text |
| 85 | +fix: add debouncing to asset scroller to correct browser scroll position |
| 86 | +
|
| 87 | +There is no debouncing when we store the asset container's scroll position. |
| 88 | +This results in erratic, jumpy scrolling and a poor user experience. Improve |
| 89 | +stability and usability with debouncing. |
| 90 | +
|
| 91 | +closes #123 |
| 92 | +``` |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +# Code Style |
| 97 | + |
| 98 | +We aim for clean, consistent code style. We're using ESlint to check for codestyle issues. |
| 99 | + |
| 100 | +## Verifying linting style |
| 101 | + |
| 102 | +``` |
| 103 | +npm run lint |
| 104 | +``` |
| 105 | + |
| 106 | +## Fixing lint issues |
| 107 | + |
| 108 | +``` |
| 109 | +npm run lint:fix |
| 110 | +``` |
| 111 | + |
| 112 | +To help reduce the effort of creating contributions with this style, an [.editorconfig file](http://editorconfig.org/) is provided that your editor may use to override any conflicting global defaults and automate a subset of the style settings. |
| 113 | + |
| 114 | +# Testing |
| 115 | + |
| 116 | +We aim for a (near) 75% test coverage, so make sure your tests cover as much of your code as possible. |
| 117 | + |
| 118 | +## Test coverage |
| 119 | + |
| 120 | +During development, you can easily check coverage by running `npm test`. |
| 121 | + |
| 122 | +Please follow these Testing guidelines when writing your unit tests: |
| 123 | + |
| 124 | +- Include a top-level `describe('ClassName')` block, with the name of the class you are testing |
| 125 | +- Inside that top-level `describe()` block, create another `describe('#methodOne()')` block for each class method you might create or modify |
| 126 | +- For each method, include an `it('should do something')` test case for each logical edge case in your changes |
| 127 | +- As you write tests, check the code coverage and make sure all lines of code are covered. If not, just add more test cases until everything is covered |
| 128 | +- For reference and inspiration, please check our `tests` directory |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +Thanks again for being a contributor to the Serverless Community :tada:! |
| 133 | + |
| 134 | +Thanks! |
0 commit comments