Show More
@@ -1,174 +1,174 b'' | |||||
1 | .. _contributing: |
|
1 | .. _contributing: | |
2 |
|
2 | |||
3 | ========================= |
|
3 | ========================= | |
4 | Contributing to Kallithea |
|
4 | Contributing to Kallithea | |
5 | ========================= |
|
5 | ========================= | |
6 |
|
6 | |||
7 | Kallithea is developed and maintained by its users. Please join us and scratch |
|
7 | Kallithea is developed and maintained by its users. Please join us and scratch | |
8 | your own itch. |
|
8 | your own itch. | |
9 |
|
9 | |||
10 |
|
10 | |||
11 | Infrastructure |
|
11 | Infrastructure | |
12 | -------------- |
|
12 | -------------- | |
13 |
|
13 | |||
14 | The main repository is hosted on Our Own Kallithea (aka OOK) at |
|
14 | The main repository is hosted on Our Own Kallithea (aka OOK) at | |
15 | https://kallithea-scm.org/repos/kallithea/, our self-hosted instance |
|
15 | https://kallithea-scm.org/repos/kallithea/, our self-hosted instance | |
16 | of Kallithea. |
|
16 | of Kallithea. | |
17 |
|
17 | |||
18 | For now, we use Bitbucket_ for `pull requests`_ and `issue tracking`_. The |
|
18 | For now, we use Bitbucket_ for `pull requests`_ and `issue tracking`_. The | |
19 | issue tracker is for tracking bugs, not for support, discussion, or ideas -- |
|
19 | issue tracker is for tracking bugs, not for support, discussion, or ideas -- | |
20 | please use the `mailing list`_ or :ref:`IRC <readme>` to reach the community. |
|
20 | please use the `mailing list`_ or :ref:`IRC <readme>` to reach the community. | |
21 |
|
21 | |||
22 | We use Weblate_ to translate the user interface messages into languages other |
|
22 | We use Weblate_ to translate the user interface messages into languages other | |
23 | than English. Join our project on `Hosted Weblate`_ to help us. |
|
23 | than English. Join our project on `Hosted Weblate`_ to help us. | |
24 | To register, you can use your Bitbucket or GitHub account. See :ref:`translations` |
|
24 | To register, you can use your Bitbucket or GitHub account. See :ref:`translations` | |
25 | for more details. |
|
25 | for more details. | |
26 |
|
26 | |||
27 |
|
27 | |||
28 | Getting started |
|
28 | Getting started | |
29 | --------------- |
|
29 | --------------- | |
30 |
|
30 | |||
31 | To get started with development:: |
|
31 | To get started with development:: | |
32 |
|
32 | |||
33 | hg clone https://kallithea-scm.org/repos/kallithea |
|
33 | hg clone https://kallithea-scm.org/repos/kallithea | |
34 | cd kallithea |
|
34 | cd kallithea | |
35 | virtualenv ../kallithea-venv |
|
35 | virtualenv ../kallithea-venv | |
36 | source ../kallithea-venv/bin/activate |
|
36 | source ../kallithea-venv/bin/activate | |
37 | pip install --upgrade pip setuptools |
|
37 | pip install --upgrade pip setuptools | |
38 | pip install -e . |
|
38 | pip install -e . | |
39 | paster make-config Kallithea my.ini |
|
39 | paster make-config Kallithea my.ini | |
40 | paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp |
|
40 | paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp | |
41 | paster serve my.ini --reload & |
|
41 | paster serve my.ini --reload & | |
42 | firefox http://127.0.0.1:5000/ |
|
42 | firefox http://127.0.0.1:5000/ | |
43 |
|
43 | |||
44 | You can also start out by forking https://bitbucket.org/conservancy/kallithea |
|
44 | You can also start out by forking https://bitbucket.org/conservancy/kallithea | |
45 | on Bitbucket_ and create a local clone of your own fork. |
|
45 | on Bitbucket_ and create a local clone of your own fork. | |
46 |
|
46 | |||
47 |
|
47 | |||
48 | Running tests |
|
48 | Running tests | |
49 | ------------- |
|
49 | ------------- | |
50 |
|
50 | |||
51 | After finishing your changes make sure all tests pass cleanly. You can run |
|
51 | After finishing your changes make sure all tests pass cleanly. You can run | |
52 | the testsuite running ``py.test`` from the project root, or if you use tox |
|
52 | the testsuite running ``py.test`` from the project root, or if you use tox | |
53 | run ``tox`` for Python 2.6--2.7 with multiple database test. |
|
53 | run ``tox`` for Python 2.6--2.7 with multiple database test. | |
54 |
|
54 | |||
55 | When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the |
|
55 | When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the | |
56 | SQLite database specified there. |
|
56 | SQLite database specified there. | |
57 |
|
57 | |||
58 | It is possible to avoid recreating the full test database on each invocation of |
|
58 | It is possible to avoid recreating the full test database on each invocation of | |
59 | the tests, thus eliminating the initial delay. To achieve this, run the tests as:: |
|
59 | the tests, thus eliminating the initial delay. To achieve this, run the tests as:: | |
60 |
|
60 | |||
61 | paster serve kallithea/tests/test.ini --pid-file=test.pid --daemon |
|
61 | paster serve kallithea/tests/test.ini --pid-file=test.pid --daemon | |
62 | KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 py.test |
|
62 | KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 py.test | |
63 | kill -9 $(cat test.pid) |
|
63 | kill -9 $(cat test.pid) | |
64 |
|
64 | |||
65 | In these commands, the following variables are used:: |
|
65 | In these commands, the following variables are used:: | |
66 |
|
66 | |||
67 | KALLITHEA_WHOOSH_TEST_DISABLE=1 - skip whoosh index building and tests |
|
67 | KALLITHEA_WHOOSH_TEST_DISABLE=1 - skip whoosh index building and tests | |
68 | KALLITHEA_NO_TMP_PATH=1 - disable new temp path for tests, used mostly for testing_vcs_operations |
|
68 | KALLITHEA_NO_TMP_PATH=1 - disable new temp path for tests, used mostly for testing_vcs_operations | |
69 |
|
69 | |||
70 | You can run individual tests by specifying their path as argument to py.test. |
|
70 | You can run individual tests by specifying their path as argument to py.test. | |
71 | py.test also has many more options, see `py.test -h`. Some useful options |
|
71 | py.test also has many more options, see `py.test -h`. Some useful options | |
72 | are:: |
|
72 | are:: | |
73 |
|
73 | |||
74 | -k EXPRESSION only run tests which match the given substring |
|
74 | -k EXPRESSION only run tests which match the given substring | |
75 |
expression. An expression is a python evalua |
|
75 | expression. An expression is a python evaluable | |
76 | expression where all names are substring-matched |
|
76 | expression where all names are substring-matched | |
77 | against test names and their parent classes. Example: |
|
77 | against test names and their parent classes. Example: | |
78 | -x, --exitfirst exit instantly on first error or failed test. |
|
78 | -x, --exitfirst exit instantly on first error or failed test. | |
79 | --lf rerun only the tests that failed at the last run (or |
|
79 | --lf rerun only the tests that failed at the last run (or | |
80 | all if none failed) |
|
80 | all if none failed) | |
81 | --ff run all tests but run the last failures first. This |
|
81 | --ff run all tests but run the last failures first. This | |
82 | may re-order tests and thus lead to repeated fixture |
|
82 | may re-order tests and thus lead to repeated fixture | |
83 | setup/teardown |
|
83 | setup/teardown | |
84 | --pdb start the interactive Python debugger on errors. |
|
84 | --pdb start the interactive Python debugger on errors. | |
85 | -s, --capture=no don't capture stdout (any stdout output will be |
|
85 | -s, --capture=no don't capture stdout (any stdout output will be | |
86 | printed immediately) |
|
86 | printed immediately) | |
87 |
|
87 | |||
88 |
|
88 | |||
89 | Coding/contribution guidelines |
|
89 | Coding/contribution guidelines | |
90 | ------------------------------ |
|
90 | ------------------------------ | |
91 |
|
91 | |||
92 | Kallithea is GPLv3 and we assume all contributions are made by the |
|
92 | Kallithea is GPLv3 and we assume all contributions are made by the | |
93 | committer/contributor and under GPLv3 unless explicitly stated. We do care a |
|
93 | committer/contributor and under GPLv3 unless explicitly stated. We do care a | |
94 | lot about preservation of copyright and license information for existing code |
|
94 | lot about preservation of copyright and license information for existing code | |
95 | that is brought into the project. |
|
95 | that is brought into the project. | |
96 |
|
96 | |||
97 | We don't have a formal coding/formatting standard. We are currently using a mix |
|
97 | We don't have a formal coding/formatting standard. We are currently using a mix | |
98 | of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and |
|
98 | of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and | |
99 | consistency with existing code. Run whitespacecleanup.sh to avoid stupid |
|
99 | consistency with existing code. Run whitespacecleanup.sh to avoid stupid | |
100 | whitespace noise in your patches. |
|
100 | whitespace noise in your patches. | |
101 |
|
101 | |||
102 | We support both Python 2.6.x and 2.7.x and nothing else. For now we don't care |
|
102 | We support both Python 2.6.x and 2.7.x and nothing else. For now we don't care | |
103 | about Python 3 compatibility. |
|
103 | about Python 3 compatibility. | |
104 |
|
104 | |||
105 | We try to support the most common modern web browsers. IE9 is still supported |
|
105 | We try to support the most common modern web browsers. IE9 is still supported | |
106 | to the extent it is feasible, IE8 is not. |
|
106 | to the extent it is feasible, IE8 is not. | |
107 |
|
107 | |||
108 | We primarily support Linux and OS X on the server side but Windows should also work. |
|
108 | We primarily support Linux and OS X on the server side but Windows should also work. | |
109 |
|
109 | |||
110 | HTML templates should use 2 spaces for indentation ... but be pragmatic. We |
|
110 | HTML templates should use 2 spaces for indentation ... but be pragmatic. We | |
111 | should use templates cleverly and avoid duplication. We should use reasonable |
|
111 | should use templates cleverly and avoid duplication. We should use reasonable | |
112 | semantic markup with element classes and IDs that can be used for styling and testing. |
|
112 | semantic markup with element classes and IDs that can be used for styling and testing. | |
113 | We should only use inline styles in places where it really is semantic (such as |
|
113 | We should only use inline styles in places where it really is semantic (such as | |
114 | ``display: none``). |
|
114 | ``display: none``). | |
115 |
|
115 | |||
116 | JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline |
|
116 | JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline | |
117 | multiline functions should be indented two levels -- one for the ``()`` and one for |
|
117 | multiline functions should be indented two levels -- one for the ``()`` and one for | |
118 | ``{}``. |
|
118 | ``{}``. | |
119 | Variables holding jQuery objects should be named with a leading ``$``. |
|
119 | Variables holding jQuery objects should be named with a leading ``$``. | |
120 |
|
120 | |||
121 | Commit messages should have a leading short line summarizing the changes. For |
|
121 | Commit messages should have a leading short line summarizing the changes. For | |
122 | bug fixes, put ``(Issue #123)`` at the end of this line. |
|
122 | bug fixes, put ``(Issue #123)`` at the end of this line. | |
123 |
|
123 | |||
124 | Use American English grammar and spelling overall. Use `English title case`_ for |
|
124 | Use American English grammar and spelling overall. Use `English title case`_ for | |
125 | page titles, button labels, headers, and 'labels' for fields in forms. |
|
125 | page titles, button labels, headers, and 'labels' for fields in forms. | |
126 |
|
126 | |||
127 | .. _English title case: https://en.wikipedia.org/wiki/Capitalization#Title_case |
|
127 | .. _English title case: https://en.wikipedia.org/wiki/Capitalization#Title_case | |
128 |
|
128 | |||
129 | Contributions will be accepted in most formats -- such as pull requests on |
|
129 | Contributions will be accepted in most formats -- such as pull requests on | |
130 | bitbucket, something hosted on your own Kallithea instance, or patches sent by |
|
130 | bitbucket, something hosted on your own Kallithea instance, or patches sent by | |
131 | email to the `kallithea-general`_ mailing list. |
|
131 | email to the `kallithea-general`_ mailing list. | |
132 |
|
132 | |||
133 | Make sure to test your changes both manually and with the automatic tests |
|
133 | Make sure to test your changes both manually and with the automatic tests | |
134 | before posting. |
|
134 | before posting. | |
135 |
|
135 | |||
136 | We care about quality and review and keeping a clean repository history. We |
|
136 | We care about quality and review and keeping a clean repository history. We | |
137 | might give feedback that requests polishing contributions until they are |
|
137 | might give feedback that requests polishing contributions until they are | |
138 | "perfect". We might also rebase and collapse and make minor adjustments to your |
|
138 | "perfect". We might also rebase and collapse and make minor adjustments to your | |
139 | changes when we apply them. |
|
139 | changes when we apply them. | |
140 |
|
140 | |||
141 | We try to make sure we have consensus on the direction the project is taking. |
|
141 | We try to make sure we have consensus on the direction the project is taking. | |
142 | Everything non-sensitive should be discussed in public -- preferably on the |
|
142 | Everything non-sensitive should be discussed in public -- preferably on the | |
143 | mailing list. We aim at having all non-trivial changes reviewed by at least |
|
143 | mailing list. We aim at having all non-trivial changes reviewed by at least | |
144 | one other core developer before pushing. Obvious non-controversial changes will |
|
144 | one other core developer before pushing. Obvious non-controversial changes will | |
145 | be handled more casually. |
|
145 | be handled more casually. | |
146 |
|
146 | |||
147 | For now we just have one official branch ("default") and will keep it so stable |
|
147 | For now we just have one official branch ("default") and will keep it so stable | |
148 | that it can be (and is) used in production. Experimental changes should live |
|
148 | that it can be (and is) used in production. Experimental changes should live | |
149 | elsewhere (for example in a pull request) until they are ready. |
|
149 | elsewhere (for example in a pull request) until they are ready. | |
150 |
|
150 | |||
151 | .. _translations: |
|
151 | .. _translations: | |
152 | .. include:: ./../kallithea/i18n/how_to |
|
152 | .. include:: ./../kallithea/i18n/how_to | |
153 |
|
153 | |||
154 |
|
154 | |||
155 | "Roadmap" |
|
155 | "Roadmap" | |
156 | --------- |
|
156 | --------- | |
157 |
|
157 | |||
158 | We do not have a road map but are waiting for your contributions. Refer to the |
|
158 | We do not have a road map but are waiting for your contributions. Refer to the | |
159 | wiki_ for some ideas of places we might want to go -- contributions in these |
|
159 | wiki_ for some ideas of places we might want to go -- contributions in these | |
160 | areas are very welcome. |
|
160 | areas are very welcome. | |
161 |
|
161 | |||
162 |
|
162 | |||
163 | Thank you for your contribution! |
|
163 | Thank you for your contribution! | |
164 | -------------------------------- |
|
164 | -------------------------------- | |
165 |
|
165 | |||
166 |
|
166 | |||
167 | .. _Weblate: http://weblate.org/ |
|
167 | .. _Weblate: http://weblate.org/ | |
168 | .. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open |
|
168 | .. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open | |
169 | .. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests |
|
169 | .. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests | |
170 | .. _bitbucket: http://bitbucket.org/ |
|
170 | .. _bitbucket: http://bitbucket.org/ | |
171 | .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general |
|
171 | .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general | |
172 | .. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general |
|
172 | .. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general | |
173 | .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/ |
|
173 | .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/ | |
174 | .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home |
|
174 | .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home |
General Comments 0
You need to be logged in to leave comments.
Login now