-
Notifications
You must be signed in to change notification settings - Fork 867
Library Maintainers Guide
David Conran edited this page May 23, 2018
·
28 revisions
All of the code in this library (including examples and tools) tries to comply with various style guides. We also have a automated zero-tolerance for lint errors. All commits are subjected to automated style guide & lint checks as part of the Travis checks. You should run these checks prior to committing or sending a PR etc.
- Spaces, not tabs. Indents with two spaces.
- Limit line lengths to 80 characters. URLs are exempt.
- For overall style consistency, if there is an available ''Google'' code style guide, follow that.
- Use meaningful identifiers. Single letter variables etc are really only acceptable for iterators on small loops.
- Write your code so that it can be unit tested.
- Write unit tests.
- These are a guide only, not rules. They can be broken when appropriate. The universe will not end. ;-)
- Style guide: Google C++ Style Guide
- Linter: cpplint
- Checks enforced for: *.{h,c,cc,cpp,hpp,ino}
- Style guide: Google Python Style Guide
- Linter: pylint with pylintrc config.
- Automatic code style formatting: yapf with a .style.yapf config. e.g. Google and two-space indents.
- Checks enforced for: *.py
- Please write unit tests for your code. They are preferred, not a requirement. However it is good engineering practice to write them.
- Indicate in your commits/PR if you have/haven't actually tested the code, especially if there are no Unit Tests for it.
- Run all the existing unit tests before you commit/create a PR. Travis will also do it but it will email everyone saying something broke. It will save you some embarrassment. ;-)
- It is "best practice" to have your code reviewed by someone else prior to submission. Do it, but it's not a hard requirement.
- If no changes have been requested by a reviewer after a week or so (including no response) you can submit the code.
- You only need a single review approval before merging.
- As a reviewer, try to offer constructive advice and if it is trivial, make the change required in the PR if you can.
- Be kind to first-time or novice contributors, but don't compromise the library to accommodate them obviously.
- Emergency non-reviewed commits & PRs are fine. Use your common sense. i.e. A trivial change that fixes a bug. Typos etc.
-
git checkout master; git pull
Make sure your master branch is up-to-date -
git checkout -b vXX.YY.ZZ
Where vXX.YY.ZZ is the new version string. e.g. v2.3.2 - Change the library version in the code:
- Update
_IRREMOTEESP8266_VERSION_
insrc/IRremoteESP8266.h
to the new version number. - Update
version
inlibrary.json
&version=
inlibrary.properties
accordingly. - All three must be the same.
- Update
- Update the version information in the documentation:
- Update "Now Available" section in
README.md
. - Update
ReleaseNotes.md
and add a new section for the new release.-
git log
should show you the change history. - Update the date to today's date for the new release.
-
- Update "Now Available" section in
- Run
tools/mkkeywords > keywords.txt
from the top directory. (Requires a Linux machine etc) -
git diff
and review the changes are what you expect. -
git commit -a
and create an appropriate entry. e.g. "v2.3.2 release" git push --set-upstream origin vXX.YY.ZZ
- Wait for the Travis build to complete successfully.
- Create a Pull Request to the 'master' branch:
- Set appropriate reviewers as needed.
- Copy in the new section of the
ReleaseNotes.md
as the PR comment.
-
Wait for:
- Approval (or not, all the substantial commits should have already been done)
- Travis to pass
- Only then, merge to master.
- Go to the Releases tab in github.
- Click "Draft a new release".
-
Tag Version
: vXX.YY.ZZ -
Target
: Master -
Release title
: IRremoteESP8266 -
Notes
: Cut & paste from theReleaseNotes.md
update. - Make sure the pre-release checkbox is un-checked.
- Click the Preview tab and check it looks okay.
- Publish Release
- The new release is now live. Arduino IDE's Library Manager should pick up the new version within 24 hours.
- Update any reported bugs that were fixed by changes that happened between this new version and the now previous one.
- Relax. Grab a cold beverage. It's all done.