Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
Add general "Code standards" page
Browse files Browse the repository at this point in the history
  • Loading branch information
seancolsen committed Jul 19, 2017
1 parent 58c6bad commit 8ade808
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
22 changes: 22 additions & 0 deletions docs/standards/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Code standards

This comment has been minimized.

Copy link
@JoeMurray

JoeMurray Jul 20, 2017

Contributor

Coding


In general, CiviCRM follow's the [Drupal Coding Standards](https://www.drupal.org/docs/develop/standards), but we have some minor modifications which are noted specifically in the other pages in this chapter.

## Continuous integration

Jenkins will automatically check all pull requests for code standards conformance, and code which does not meet the standards will not be merged.

This comment has been minimized.

Copy link
@JoeMurray

JoeMurray Jul 20, 2017

Contributor

coding standards



## Tools

If you have a development site with [buildkit]() you can use [Civilint](/tools/civilint.md) to check your code against CiviCRM's code standards.

This comment has been minimized.

Copy link
@JoeMurray

JoeMurray Jul 20, 2017

Contributor

coding standards


You can also [set up your IDE](https://wiki.civicrm.org/confluence/display/CRMDOC/IDE+Settings+to+Meet+Coding+Standards) to lint your code.


## Improving code conformance

If you find code that is not meeting the standards, we encourage you to improve it! But please follow these guidelines when doing so:

* Create a Jira issue for your code standard improvements which is separate from any other code changes you happen to be making at the time.
* Isolate your code standards improvements into commits which do not contain otherwise unrelated changes.

This comment has been minimized.

Copy link
@JoeMurray

JoeMurray Jul 20, 2017

Contributor

coding standards

6 changes: 0 additions & 6 deletions docs/standards/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,3 @@ The CiviCRM Coding Standard for PHP Code and Inline Documentation applies to all
1. `tools/`
1. `joomla/`
1. `WordPress/`

## Tools

If a developer creates a test site with buildkit they can use the CiviLint tool to check the code standards. See [Civilint Documentation](/tools/civilint.md).

You can also Set up your IDE to lint your code as well. See instructions on [setting up your IDE](https://wiki.civicrm.org/confluence/display/CRMDOC/IDE+Settings+to+Meet+Coding+Standards).
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ pages:
- hook_civicrm_tokenValues: hooks/hook_civicrm_tokenValues.md
- hook_civicrm_unhandledException: hooks/hook_civicrm_unhandledException.md
- Code Standards:
- PHP: standards/php.md
- SQL: standards/sql.md
- Code Standards: standards/index.md
- PHP Standards: standards/php.md
- SQL Standards: standards/sql.md
# Javascript: standards/js.md
# API: standards/api.md
# Git: standards/git.md
Expand Down

0 comments on commit 8ade808

Please sign in to comment.