Debian Codegraph @

doc/CONTRIBUTING.md

raw
1 # How to contribute to BleachBit
2
3 Thank you for your interest in contributing.
4
5
6 ## When to file a bug report
7
8 If you are not using the [latest stable version](https://www.bleachbit.org/download), try upgrading. Windows users can also try [CI builds](https://ci.bleachbit.org/).
9
10 If you are on the latest, stable version, check "known issues" section of [release notes](https://www.bleachbit.org/news).
11
12 ## Where to file an issue
13
14 Most bug reports should be filed in [GitHub under the BleachBit repository](https://github.com/bleachbit/bleachbit/issues/new).
15
16 Bug reports were managed in [Launchpad](https://bugs.launchpad.net/bleachbit/) between about 2009 and 2016. Launchpad still contains some active issue tickets, but more recently users are encouraged to file issue tickets in GitHub.
17
18
19 ## Information to include with bug reports
20
21 When filing a [bug report](https://github.com/bleachbit/bleachbit/issues/new), the issue template will guide you on which information to include.
22
23 If you are reporting an error that happens while cleaning ([example screenshot](https://user-images.githubusercontent.com/22394276/31048383-42d469d8-a61c-11e7-9a7d-d149887ce2f3.jpg)), please try to narrow it down a single cleaning option (in other words, a single checkbox).
24
25 Three kinds of information are often helpful:
26
27 1. Screenshot: to include a screenshot, you can either drag-and-drop it like a file attachment or use CTRL+V to paste it from the clipboard into the GitHub comment form.
28
29 2. BleachBit log: this is the text that BleachBit shows while it is running. You can copy and paste it as text. Do not include hundreds of lines, but try to narrow it down to the interesting parts, like error messages. [Enabling debug logging](https://docs.bleachbit.org/doc/troubleshooting.html) using the launcher or preferences may show more information.
30
31 3. BleachBit [system information](https://docs.bleachbit.org/doc/troubleshooting.html): this is a window inside of BleachBit that includes general information about your system. Copy and paste this as text, and paste it into GitHub.
32
33 See also [prioritization of issues](https://www.bleachbit.org/contribute/prioritization-issues).
34
35
36 ## Development environment
37
38 BleachBit 4.x runs on Python 3 with GTK 3. See also [running from source](https://docs.bleachbit.org/dev/running-from-source-code.html) regarding dependencies.
39
40
41 ## Procedure for creating and submitting patch
42
43 Following this process will help your changes get merged sooner. If you plan to write a major change, please consider first opening a GitHub issue to discuss.
44
45 * Log in to GitHub.
46 * Fork the right BleachBit repository, as there are several repositories.
47 * Check out your forked repository.
48 * Make your changes.
49 * Test your changes. Consider adding or expanding a unit test.
50 * Run the unit tests by running
51 ````
52 PYTHONWARNINGS=error python3 -m tests.TestAll
53 ````
54 * Make commits in small, logical units to make them easier to review.
55 * Submit the pull request.
56 * Check that it passes the tests by GitHub Actions.
57
58 If you have multiple commits around multiple themes (such as adding two, unrelated features), please consider breaking them up into multiple pull requests by using multiple branches. Smaller pull requests are easier to review and commit.
59
60 Please consider reviewing someone else's pull requests and asking him or her to do the same for you. This can improve quality and get your changes merged sooner.
61
62
63 ## Coding style
64
65 * Indent with four spaces instead of tabs.
66 * Format your code using PEP-8 standards like this:
67 ````autopep8 -i bleachbit/Action.py````
68 * Follow other best practices such as they relate to readability, documentation, error handling, and performance.
69 * Run pylint to check for issues.
70 * Each function should have a basic docstring. Sometimes, a single line may be sufficient.
71 Docstrings may optionally use Google style or reStructuredText (reST) syntax for formatting.
72 * See OpenStack [Git Commit Good Practice](https://wiki.openstack.org/wiki/GitCommitMessages) for advice on writing good Git commit messages. In particular, the first line of the commit message is important.
73
74 ## Messages in the user interface
75
76 Scenarios to use an ellipsis:
77 - An ongoing action, such as "Downloading...".
78 - A button or context menu item that opens a dialog requiring user interaction.
79 (Button that immediately performs action does not use ellipsis.)
80
81 For ongoing action, use the present participle (e.g., "Downloading...") with
82 an ellipsis instead of "Download in progress".
83
84 Messages default to sentence case (with just the first word capitalized),
85 except for window titles and proper nouns that use title case instead.
86
87 ### Writing localizable strings
88
89 For messages with multiple placeholders, use named placeholders, so the order
90 can be changed.
91
92 To avoid extra work for translators, reuse an existing message when possible.
93 Check `po/bleachbit.pot` for existing messages.
94
95 ### Translation hints
96
97 Help translators by including a helpful translator comment. Types of
98 information to include:
99 - UI element type (e.g., button label).
100 - Clarification for parts of speech (e.g., "file" could be a verb or noun).
101 - Clarification regarding any unique words.
102 - Clarification regarding any placeholders.
103
104 Omit obvious information, and do not repeat the string itself.
105
106 In Python, the hint must start with the capitalized keyword TRANSLATORS. It
107 must be on the previous row before the string to translate. It is okay for
108 the translation hint comment to be multiple lines.
109
110 The following hint would not be detected because of the extra line between
111 the hint and localizable string.
112
113 ```py
114 # TRANSLATORS: Title of a folder chooser dialog.
115 show_the_browse_folder_dialog(self.window,
116 _("Choose folder to shred"))
117 ```
118
119 In this example, the hint would apply only to the first string,
120 and there would be no hint for the second string.
121
122 ```py
123 # TRANSLATORS: Noun indicating file type - either 'File' or 'Folder'.
124 type_str = _('File') if path_type == 'file' else _('Folder')
125 ```
126
127 The following works:
128
129 ```py
130 show_the_browse_folder_dialog(self.window,
131 # TRANSLATORS: Title of a folder chooser dialog.
132 # More translation hint on a second line.
133 # Third line of hint.
134 _("Choose folder to shred"))
135 ```