|
3 | 3 | Python code style is enforced with the flake8 linter, see [`tests/lint/readme.md`](https://github.com/nvaccess/nvda/tree/master/tests/lint/readme.md) for more information. |
4 | 4 |
|
5 | 5 | ### Encoding |
| 6 | + |
6 | 7 | * Where Python files contain non-ASCII characters, they should be encoded in UTF-8. |
7 | | - * There should be no Unicode BOM at the start of the file, as this unfortunately breaks one of the translation tools we use (`xgettext`). |
8 | | - Instead, include this as the first line of the file, only if the file contains non-ASCII characters: |
9 | | - ```py |
10 | | - # -*- coding: UTF-8 -*- |
11 | | - ``` |
12 | | - * This coding comment must also be included if strings in the code (even strings that aren't translatable) contain escape sequences that produce non-ASCII characters; e.g. `"\xff"`. |
| 8 | + * There should be no Unicode BOM at the start of the file, as this unfortunately breaks one of the translation tools we use (`xgettext`). |
| 9 | + Instead, include this as the first line of the file, only if the file contains non-ASCII characters: |
| 10 | + |
| 11 | + ```py |
| 12 | + # -*- coding: UTF-8 -*- |
| 13 | + ``` |
| 14 | + |
| 15 | + * This coding comment must also be included if strings in the code (even strings that aren't translatable) contain escape sequences that produce non-ASCII characters; e.g. `"\xff"`. |
13 | 16 | This is particularly relevant for braille display drivers. |
14 | 17 | This is due to a `gettext` bug; see [comment on #2592](https://github.com/nvaccess/nvda/issues/2592#issuecomment-155299911). |
15 | | -* New files should contain `LF` line endings, however NVDA currently uses a mix of LF and CRLF line endings. |
16 | | -See issue [#12387](https://github.com/nvaccess/nvda/issues/12387). |
| 18 | +* Text files should be committed with `LF` line endings. |
| 19 | +Files can be checked out locally using CRLF if needed for Windows development using [git](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf). |
17 | 20 |
|
18 | 21 | ### Indentation |
19 | 22 | * Indentation must be done with tabs (one per level), not spaces. |
|
0 commit comments