From a4f895dc4ded1c8d000e6e08df782c087fab8bf1 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 12 Jan 2014 16:56:05 +0000 Subject: [PATCH] Introduce coding style guidelines --- contributing.md | 2 +- editions/tw5.com/tiddlers/Contributing.tid | 6 ++- .../TiddlyWiki Coding Style Guidelines.tid | 39 +++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 editions/tw5.com/tiddlers/dev/TiddlyWiki Coding Style Guidelines.tid diff --git a/contributing.md b/contributing.md index 06b084cc0..90d56685b 100644 --- a/contributing.md +++ b/contributing.md @@ -1,3 +1,3 @@ -

Contributing to TiddlyWiki5

TiddlyWiki5 welcomes contributions to its code and documentation via GitHub. Please take a moment to read these notes to help make the process as smooth as possible.

GitHub Issues

We use GitHub Issues to manage bug reports, feature requests for TiddlyWiki. To maintain their effectiveness we endeavour to have as few open issues as possible.

Policies for Managing Issues

Open issues must be actionable: generally either a reproducible bug report, or a specific feature request. From the perspective of the core developers, the issues list behaves like a shared todo list. Every item on the list requires a little bit of attention each time we check the list.

GitHub Issues are not very good for managing ideas that are not immediately actionable. Better to use the TiddlyWiki discussion groups for open ended questions, or speculative discussions of new features.

Creating Issues

When you do create an issue, remember that for effective debugging, we need as much information as possible. At a minimum, please try to include:

Consider also adding screenshots if it makes things clearer.

There's a lot of good material on the web about bug reports:

Contributor License Agreement

Like other OpenSource projects, TiddlyWiki5 needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the UnaMesa Association (the legal entity that owns TiddlyWiki on behalf of the community).

This is a first pass at a CLA for TiddlyWiki. Please let us know if we missed something important. If we do have to make essential changes to the CLA, there is a possibility that all contributors will need to sign it again

How to sign the CLA

Create a GitHub pull request to add your name to cla-individual.md or cla-entity.md, with the date in the format (YYYY/MM/DD).

eg: Jeremy Ruston, @Jermolene, 2011/11/22

Thank you!

Attribution

The CLA documents used for this project where created using Harmony Project Templates. "HA-CLA-I-LIST Version 1.0" for "CLA-individual" and "HA-CLA-E-LIST Version 1.0" for "CLA-entity" +

Contributing to TiddlyWiki5

TiddlyWiki5 welcomes contributions to its code and documentation via GitHub. Please take a moment to read these notes to help make the process as smooth as possible.

Coding Style

Code contributions should follow the TiddlyWiki Coding Style Guidelines.

GitHub Issues

We use GitHub Issues to manage bug reports, feature requests for TiddlyWiki. To maintain their effectiveness we endeavour to have as few open issues as possible.

Policies for Managing Issues

Open issues must be actionable: generally either a reproducible bug report, or a specific feature request. From the perspective of the core developers, the issues list behaves like a shared todo list. Every item on the list requires a little bit of attention each time we check the list.

GitHub Issues are not very good for managing ideas that are not immediately actionable. Better to use the TiddlyWiki discussion groups for open ended questions, or speculative discussions of new features.

Creating Issues

When you do create an issue, remember that for effective debugging, we need as much information as possible. At a minimum, please try to include:

Consider also adding screenshots if it makes things clearer.

There's a lot of good material on the web about bug reports:

Contributor License Agreement

Like other OpenSource projects, TiddlyWiki5 needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the UnaMesa Association (the legal entity that owns TiddlyWiki on behalf of the community).

This is a first pass at a CLA for TiddlyWiki. Please let us know if we missed something important. If we do have to make essential changes to the CLA, there is a possibility that all contributors will need to sign it again

How to sign the CLA

Create a GitHub pull request to add your name to cla-individual.md or cla-entity.md, with the date in the format (YYYY/MM/DD).

eg: Jeremy Ruston, @Jermolene, 2011/11/22

Thank you!

Attribution

The CLA documents used for this project where created using Harmony Project Templates. "HA-CLA-I-LIST Version 1.0" for "CLA-individual" and "HA-CLA-E-LIST Version 1.0" for "CLA-entity"

This file was automatically generated by TiddlyWiki5

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Contributing.tid b/editions/tw5.com/tiddlers/Contributing.tid index 028cf9cde..f7967895e 100644 --- a/editions/tw5.com/tiddlers/Contributing.tid +++ b/editions/tw5.com/tiddlers/Contributing.tid @@ -1,11 +1,15 @@ created: 20131101111400000 -modified: 20140110101537722 +modified: 20140112164329806 tags: introduction title: Contributing type: text/vnd.tiddlywiki TiddlyWiki5 welcomes contributions to its code and documentation via [[GitHub|https://github.com/Jermolene/TiddlyWiki5]]. Please take a moment to read these notes to help make the process as smooth as possible. +!! Coding Style + +Code contributions should follow the [[TiddlyWiki Coding Style Guidelines]]. + !! GitHub Issues We use GitHub Issues to manage bug reports, feature requests for TiddlyWiki. To maintain their effectiveness we endeavour to have as few open issues as possible. diff --git a/editions/tw5.com/tiddlers/dev/TiddlyWiki Coding Style Guidelines.tid b/editions/tw5.com/tiddlers/dev/TiddlyWiki Coding Style Guidelines.tid new file mode 100644 index 000000000..fe6ad1e69 --- /dev/null +++ b/editions/tw5.com/tiddlers/dev/TiddlyWiki Coding Style Guidelines.tid @@ -0,0 +1,39 @@ +title: TiddlyWiki Coding Style Guidelines +tag: dev + +! Motivation + +TiddlyWiki is a large project with many interested parties. It benefits everyone if the code is as easy to read as possible. A key part of that it must be written and laid out consistently. + +! Guidelines + +!! Tabs and whitespace + +TiddlyWiki uses 4-character tabs for indenting. + +One blank line is used to separate blocks of code. Occasional blank lines are permitted within blocks for clarity, but should be avoided unless they solve a specific readability problem. + +!! Layout of basic constructs + +See the following example for layout of basic JavaScript constructs: + +``` +/* +Multiline comments are used to introduce a block of code such as a function definition +*/ +function demoFunction(param,more) { + // Proper sentence capitalisation for comments + if(condition == "something") { + // No space between "if" and the brackets; always spaces around operators + myOtherFunction(one,two); // No whitespace within function parameters + do { + myCondition.explore(); // Always use semicolons + } while(myCondition < worsens); + } +} + +``` + +!! Strings + +Double quotes are preferred over single quotes for string literals.