Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoolkit:master commit in: /
Date: Mon, 20 Sep 2021 22:58:02
Message-Id: 1632178418.12722468eeb85e63bef3e0230ed9ffe9e85ede28.mattst88@gentoo
1 commit: 12722468eeb85e63bef3e0230ed9ffe9e85ede28
2 Author: Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail <DOT> com>
3 AuthorDate: Mon Sep 20 13:49:54 2021 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 20 22:53:38 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=12722468
7
8 Rename README.dev to CONTRIBUTING.md. Also, add information...
9
10 ...regarding how to use black for formatting code, and how to ignore
11 formatting-only commits in git.
12
13 Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail.com>
14 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
15
16 .gitignorerevs | 2 ++
17 CONTRIBUTING.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 README.dev | 55 ---------------------------------------
19 3 files changed, 82 insertions(+), 55 deletions(-)
20
21 diff --git a/.gitignorerevs b/.gitignorerevs
22 new file mode 100644
23 index 0000000..86287dd
24 --- /dev/null
25 +++ b/.gitignorerevs
26 @@ -0,0 +1,2 @@
27 +# Run entire repository through black. Also, change tabs to spaces
28 +bbcd72b5fe85fe9bbca1913f8aa22077d94e75d0
29
30 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
31 new file mode 100644
32 index 0000000..e91dac8
33 --- /dev/null
34 +++ b/CONTRIBUTING.md
35 @@ -0,0 +1,80 @@
36 +Contributing
37 +============
38 +Gentoo Developers have full priviledges to the gentoolkit repository and
39 +any Gentoo developer can do work on the gentoolkit source. We only ask that you
40 +keep the following in mind:
41 +
42 +- If you want to do a major change (i.e rewrite/refactor something), please talk
43 + to us before pushing any commits. If you break something, please fix it.
44 +- All members of the Portage or Portage Tools projects are authorized to create
45 + a new release of gentoolkit or gentoolkit-dev.
46 +- All other Gentoo Developers are authorized to create a new release if it is
47 + coordinated with fuzzyray and/or dolsen.
48 +- If you create a release and it breaks, please fix it.
49 +
50 +Any non Gentoo developers who wish to contribute, the best way to get
51 +started is by cloning a copy of the repository and submitting patches to
52 +bugzilla. Additionally, we can be found in the #gentoo-portage IRC
53 +channel.
54 +
55 +Formatting
56 +==========
57 +We use [black](https://pypi.org/project/black/) to format the code
58 +base. Please make sure you run it against any PRs prior to submitting
59 +(otherwise we'll probably reject it).
60 +
61 +There are [ways to integrate](https://black.readthedocs.io/en/stable/integrations/editors.html)
62 +black into your text editor and/or IDE.
63 +
64 +You can also set up a git hook to check your commits, in case you don't want
65 +editor integration. Something like this:
66 +
67 +```sh
68 +# .git/hooks/pre-commit (don't forget to chmod +x)
69 +
70 +#!/bin/bash
71 +black --check --diff .
72 +```
73 +
74 +To ignore reformatting commits (which are listed in `.gitignorerevs`) you can do
75 +the following:
76 +
77 +```sh
78 +git config blame.ignoreRevsFile .gitignorerevs
79 +```
80 +
81 +Adding or modifying code
82 +========================
83 +- If you add new code, best practice is to write a test for it.
84 +- If you're modifying code that doesn't have a test and you can write a test
85 + for it, please do.
86 +- Before committing your changes, run "tox" to ensure that you didn't break
87 + tests or introduced a flake8 error.
88 +- If flake8 raises a warning or error that you don't agree with, it's probably
89 + better to just change your code. If you're sure you have a good reason for
90 + doing what you're doing, you can add "# noqa" at the end of the line to
91 + silence it.
92 +
93 +Creating a release
94 +==================
95 +Note: We are using VERSION="0.3.0" simply as an example.
96 +
97 +```sh
98 +# Run Gentoolkit's test suite, make sure it passes:
99 +# Note: requires dev-python/snakeoil
100 +./setup.py test
101 +
102 +# Create a source distribution (you need to add VERSION here):
103 +VERSION="0.3.0" ./setup.py sdist
104 +# Transfer dist/gentoolkit-0.3.0.tar.gz to dev.gentoo.org:/space/distfiles-local
105 +# scp dist/gentoolkit-0.3.0.tar.gz username@××××××××××.org:/space/distfiles-local
106 +
107 +# Clean up temporary files:
108 +./setup.py clean -a
109 +git status
110 +# rm or mv any untracked files/directories
111 +
112 +# Create a tag for the release
113 +git tag gentoolkit-0.3.0
114 +git push origin gentoolkit-0.3.0
115 +```
116
117 diff --git a/README.dev b/README.dev
118 deleted file mode 100644
119 index e2df152..0000000
120 --- a/README.dev
121 +++ /dev/null
122 @@ -1,55 +0,0 @@
123 -Contributing:
124 -=============
125 -Gentoo Developers have full priviledges to the gentoolkit repository and
126 -any Gentoo developer can do work on the gentoolkit source.
127 -
128 -We only have several requirements. If you want to do a major change (i.e
129 -rewrite/refactor something), please talk to us before pushing any
130 -commits. If you break something, please fix it.
131 -
132 -All members of the Portage or Portage Tools projects are authorized to
133 -create a new release of gentoolkit or gentoolkit-dev.
134 -
135 -All other Gentoo Developers are authorized to create a new release if it is
136 -coordinated with fuzzyray and/or dolsen.
137 -
138 -If you create a release and it breaks, please fix it.
139 -
140 -Any non Gentoo developers who wish to contribute, the best way to get
141 -started is by cloning a copy of the repository and submitting patches to
142 -bugzilla. Additionally, we can be found in the #gentoo-portage IRC
143 -channel.
144 -
145 -Adding or modifying code:
146 -=========================
147 -- If you add new code, best practice is to write a test for it.
148 -- If you're modifying code that doesn't have a test and you can write a test
149 - for it, please do.
150 -- Before committing your changes, run "tox" to ensure that you didn't break
151 - tests or introduced a flake8 error.
152 -- If flake8 raises a warning or error that you don't agree with, it's probably
153 - better to just change your code. If you're sure you have a good reason for
154 - doing what you're doing, you can add "# noqa" at the end of the line to
155 - silence it.
156 -
157 -Creating a release:
158 -===================
159 -Note: We are using VERSION="0.3.0" simply as an example.
160 -
161 -- Run Gentoolkit's test suite, make sure it passes:
162 -Note: requires dev-python/snakeoil
163 -
164 -./setup.py test
165 -
166 -- Create a source distribution (you need to add VERSION here):
167 -VERSION="0.3.0" ./setup.py sdist
168 -Transfer dist/gentoolkit-0.3.0.tar.gz to dev.gentoo.org:/space/distfiles-local
169 -
170 -- Clean up temporary files:
171 -./setup.py clean -a
172 -git status
173 -rm or mv any untracked files/directories
174 -
175 -- Create a tag for the release
176 -git tag gentoolkit-0.3.0
177 -git push origin gentoolkit-0.3.0