forked from I2P_Developers/i2p.www
dev guidelines update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{% extends "global/layout.html" %}
|
{% extends "global/layout.html" %}
|
||||||
{% block title %}{{ _('Developer Guidelines and Coding Style') }}{% endblock %}
|
{% block title %}{{ _('Developer Guidelines and Coding Style') }}{% endblock %}
|
||||||
{% block lastupdated %}{% trans %}October 2015{% endtrans %}{% endblock %}
|
{% block lastupdated %}{% trans %}November 2015{% endtrans %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>{% trans newdevs=site_url('get-involved/guides/new-developers') -%}
|
<p>{% trans newdevs=site_url('get-involved/guides/new-developers') -%}
|
||||||
Read the <a href="{{ newdevs }}">new developers guide</a> first.
|
Read the <a href="{{ newdevs }}">new developers guide</a> first.
|
||||||
@@ -59,7 +59,7 @@ Ensure that you have the latest monotonerc file in _MTN.
|
|||||||
Do not check in on top of untrusted revisions.
|
Do not check in on top of untrusted revisions.
|
||||||
{%- endtrans %}</li>
|
{%- endtrans %}</li>
|
||||||
<li>{% trans -%}
|
<li>{% trans -%}
|
||||||
Ensure that you pull the latest revision before you check in.
|
Ensure that you 'mtn pull' and 'mtn update' to the latest revision before you check in and push.
|
||||||
If you inadvertently diverge, merge and push as soon as possible.
|
If you inadvertently diverge, merge and push as soon as possible.
|
||||||
Don't routinely make others merge for you.
|
Don't routinely make others merge for you.
|
||||||
Yes, we know that monotone says you should push and then merge,
|
Yes, we know that monotone says you should push and then merge,
|
||||||
@@ -83,7 +83,8 @@ In some places, the coding style is different.
|
|||||||
Use common sense. Emulate the style in the file you are modifying.
|
Use common sense. Emulate the style in the file you are modifying.
|
||||||
{%- endtrans %}</li>
|
{%- endtrans %}</li>
|
||||||
<li>{% trans -%}
|
<li>{% trans -%}
|
||||||
New classes and methods require at least brief javadocs. Add @since release-number.
|
All new public and package-private classes and methods require Javadocs. Add @since release-number.
|
||||||
|
Javadocs for new private methods are desirable.
|
||||||
{%- endtrans %}</li>
|
{%- endtrans %}</li>
|
||||||
<li>{% trans -%}
|
<li>{% trans -%}
|
||||||
Classes in core/ (i2p.jar) and portions of i2ptunnel are part of our official API.
|
Classes in core/ (i2p.jar) and portions of i2ptunnel are part of our official API.
|
||||||
@@ -107,13 +108,27 @@ Be familiar with common Java pitfalls that are caught by findbugs.
|
|||||||
Run 'ant findbugs' to learn more.
|
Run 'ant findbugs' to learn more.
|
||||||
{%- endtrans %}</li>
|
{%- endtrans %}</li>
|
||||||
<li>{% trans -%}
|
<li>{% trans -%}
|
||||||
We require Java 6 to build and run I2P.
|
We require Java 7 to build and run I2P.
|
||||||
Do not use Java 7 classes or methods.
|
Do not use Java 8 classes or methods anywhere.
|
||||||
|
Do not use Java 7 or 8 classes or methods in embedded subsystems (core, router, mstreaming, streaming, i2ptunnel),
|
||||||
|
as Android and embedded applications require only Java 6.
|
||||||
{%- endtrans %}</li>
|
{%- endtrans %}</li>
|
||||||
<li>{% trans -%}
|
<li>{% trans -%}
|
||||||
Explicitly convert between primitive types and classes;
|
Explicitly convert between primitive types and classes;
|
||||||
don't rely on autoboxing/unboxing.
|
don't rely on autoboxing/unboxing.
|
||||||
{%- endtrans %}</li>
|
{%- endtrans %}</li>
|
||||||
|
<li>{% trans -%}
|
||||||
|
Don't use URL. Use URI.
|
||||||
|
{%- endtrans %}</li>
|
||||||
|
<li>{% trans -%}
|
||||||
|
Don't catch Exception. Catch RuntimeException and checked exceptions individually.
|
||||||
|
{%- endtrans %}</li>
|
||||||
|
<li>{% trans -%}
|
||||||
|
Don't use String.getBytes(). Use DataHelper.getUTF8() or DataHelper.getASCII().
|
||||||
|
{%- endtrans %}</li>
|
||||||
|
<li>{% trans -%}
|
||||||
|
Don't use String.split(). Use DataHelper.split().
|
||||||
|
{%- endtrans %}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>{{ _('Licenses') }}</h3>
|
<h3>{{ _('Licenses') }}</h3>
|
||||||
|
Reference in New Issue
Block a user