You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: projectDocs/dev/codingStandards.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,19 @@
1
1
## Code Style
2
2
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.
3
+
Python code style is enforced with the Ruff linter, see [linting](./lint.md) for more information.
4
4
5
5
### Encoding
6
-
7
6
* Where Python files contain non-ASCII characters, they should be encoded in UTF-8.
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"`.
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"`.
16
13
This is particularly relevant for braille display drivers.
17
14
This is due to a `gettext` bug; see [comment on #2592](https://github.com/nvaccess/nvda/issues/2592#issuecomment-155299911).
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).
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).
20
17
21
18
### Indentation
22
19
* Indentation must be done with tabs (one per level), not spaces.
Copy file name to clipboardExpand all lines: projectDocs/testing/automated.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,16 +27,16 @@ scons checkPot
27
27
```
28
28
29
29
### Linting your changes
30
-
In order to ensure your changes comply with NVDA's coding style you can run the Flake8 linter locally.
31
-
Some developers have found certain linting error messages misleading, these are clarified in `tests/lint/readme.md`.
32
-
runlint.bat will use Flake8 to inspect only the differences between your working directory and the specified `base` branch.
33
-
If you create a Pull Request, the `base` branch you use here should be the same as the target you would use for a Pull Request. In most cases it will be `origin/master`.
30
+
31
+
In order to ensure your changes comply with NVDA's coding style you can run the Ruff linter locally.
32
+
`runlint.bat` will use Ruff to lint and where possible, fix the code you have written.
33
+
34
34
```cmd
35
-
runlint origin/master
35
+
runlint.bat
36
36
```
37
37
38
-
To be warned about linting errors faster, you may wish to integrate Flake8 with other development tools you are using.
39
-
For more details, see `tests/lint/readme.md`
38
+
To be warned about linting errors faster, you may wish to integrate Ruff with other development tools you are using.
39
+
For more details, see the [linting docs](../dev/lint.md).
40
40
41
41
### Unit Tests
42
42
Unit tests can be run with the `rununittests.bat` script.
0 commit comments