Comments (6)
CONTRIBUTING.md
All Contributors Welcome
We define contributors as those who contribute to this project in any category at any level of contribution. This specification is, by definition, inclusive of all contributions.
We use the AllContributors đ¤ to automate acknowledging contributors to this project.
from mautic-cron-commands.
CONTRIBUTING.md
Pull Requests
It is recommended to keep your changes grouped logically within individual commits. Many contributors find it easier to review changes that are split across multiple commits. There is no limit to the number of commits in a pull request.
git add my/changed/files
git commit
âšī¸ Note:
Multiple commits in a pull request can be squashed to a single commit when they are merged
Commit message guidelines
A good commit message should describe what changed and why.
- Use the present tense ("add feature" not "added feature")
- Use the imperative mood ("move output to..." not "moves output to...")
We use semantic commit messages to streamline the release process.
Before a pull request can be merged, it must have a pull request title with a semantic prefix.
Having a consistent format allows us to automate CHANGELOG updates.
Examples of commit messages with semantic prefixes:
docs: đ address the upgrade process
feat: ⨠add command write:docs:forme
fix: đ lookup the correct parameter
from mautic-cron-commands.
CONTRIBUTING.md
Pull Requests
Commit message guidelines
Common prefixes
- feat:
:sparkles:
a new feature - fix:
:bug:
a bug fix - docs:
:memo:
documentation changes - refactor:
:art:
a code change that neither fixes a bug nor adds a feature - refactor:
:rotating_light:
a code change that does not affect the meaning of the code (linting) - perf:
:racehorse:
a code change that improves performance - test:
:white_check_mark:
adding or changing tests - chore:
:wrench:
performing repository maintenance - chore:
ī¸ī¸:tada:
release:bookmark:
1.0.0 - ci:
:green_heart:
changes to our CI configuration files and scripts - vendor:
:arrow_up:
bumping a dependency
đĄ ProTip:
Other things to keep in mind when writing a commit message:
- The first line should:
- contain a short description of the change (preferably 50 characters or less, and no more than 72 characters)
- be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, like function/variable names
- Keep the second line blank.
- Wrap all other lines at 72 columns.
- Reference issues and other pull requests liberally after the first line
from mautic-cron-commands.
CONTRIBUTING.md
Pull Requests
Commit message guidelines
Emoji
You are encouraged to include an applicable emoji in commit messages after the semantic prefix:
- â¨
:sparkles:
when adding a feature - đ
:memo:
when writing docs - đ
:bug:
when fixing a bug - âī¸
:pencil2:
when it's just a typo - đĨ
:fire:
when removing code or files - đĨ
:boom:
when there is a Breaking Change - đ¨
:art:
when improving the format/structure of the code - đ¨
:rotating_light:
when removing linter warnings - đ
:green_heart:
when fixing the CI build - â
:white_check_mark:
when adding tests - đ
:lock:
when dealing with security - đ
:tada:
when announcing a release đ:bookmark:
- đ
:rocket:
when deploying, or initiating a CI deployment - đ§
:wrench:
when performing repository maintenance - âŦī¸
:arrow_up:
when upgrading dependencies - âŦī¸
:arrow_down:
when downgrading dependencies - đ
:racehorse:
when improving performance
Breaking Changes
A commit that has the text BREAKING CHANGE:
at the beginning of its third line, or footer section, introduces a breaking change (correlating with Major in semantic versioning). A breaking change can be part of commits of any type.
e.g., a
fix:
,feat:
&chore:
types would all be valid, in addition to any other type.
See conventionalcommits.org for more details.
from mautic-cron-commands.
CONTRIBUTING.md
Coding conventions
Start reading our code and you'll get the hang of it. We optimize for readability.
If in doubt, you have some simple options:
- stay faithful to the existing style
- just ask us
- look at the editorconfig settings in
.editorconfig
TL;DR
TL;DWy
(didn't write yet)
Follow the guidelines in your IDE of choice (ie VS Code) from the most popular language extensions.
from mautic-cron-commands.
CONTRIBUTING.md
Coding conventions
PHP
Bash
Bash
What? Wait a sec!1
Error messages
STDOUT
vs STDERR
All error messages should go to STDERR.
This makes it easier to separate normal status from actual issues.
A function to print out error messages along with other status information is recommended.
error() {
printf '[%(%Y-%m-%dT%X)T]: %s\n' "$@" >&2
}
if ! do_something; then
error "Unable to do_something"
exit "${E_DID_NOTHING}"
fi
Comments
File Header
Start each file with a description of its contents.
- Every file must have a top-level comment including a brief overview of its contents.
- A copyright notice and author information are optional.
Example:
#!/usr/bin/env bash
#-*- coding: utf-8 -*-
#
# Perform hot backups of Oracle databases.
Function Comments
Any function that is not both obvious and short must be commented. Any function in a library must be commented regardless of length or complexity.
It should be possible for someone else to learn how to use your program or to use a function in your library by reading the comments (and self-help, if provided) without reading the code.
All function comments should contain:
- Description of the function
- Global variables used and modified
- Arguments accepted
- Returned values other than the default exit status of the last command run
Implementation Comments
Comment tricky, non-obvious, interesting or important parts of your code.
This follows general coding comment practice.
Don't comment everything.
- If there's a complex algorithm or you're doing something out of the ordinary, put a short comment in.
- If you paused to think about the implementation, while writing
it, put a meaningful comment in for the next person. - It might be you.
Indentation
Indent two spaces. No tabs.
- We indent using two spaces (soft tabs). Whatever you do, don't use tabs.
- Use blank lines between blocks to improve readability.
Line Length and Long Strings
We use a line length of 80 characters
- If you have to write strings that are longer than 80 characters, this should be done with a HERE document or an embedded newline if possible.
- Literal strings that have to be longer than 80 chars and can't sensibly be split are OK, but it's strongly preferred to find a way to make it shorter.
Loops
Put
; do
and; then
on the same line as thewhile
,for
orif
.
Final thoughts
This is open-source software.
-
Consider the people who will read your code, and make it look nice for them.
It's sort of like driving a car: perhaps you love doing donuts when you're alone, but with passengers, the goal is to make the ride as smooth as possible.
- This is going to be a multi repo document âŠ
from mautic-cron-commands.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mautic-cron-commands.