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: readme.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,13 @@ Additionally, the following build time dependencies are included in Git submodul
90
90
*[Boost Optional (stand-alone header)](https://github.com/akrzemi1/Optional), from commit [3922965](https://github.com/akrzemi1/Optional/commit/3922965396fc455c6b1770374b9b4111799588a9)
91
91
92
92
### Other Dependencies
93
-
These dependencies are not included in Git submodules, but aren't needed by most people.
93
+
To lint using Flake 8 locally using our SCons integration, some dependencies are installed (automatically) via pip.
94
+
Although this [must be run manually](#linting-your-changes), developers may wish to first configure a Python Virtual Environment to ensure their general install is not affected.
95
+
* Flake8
96
+
* Flake8-tabs
97
+
98
+
99
+
The following dependencies aren't needed by most people, and are not included in Git submodules:
94
100
95
101
* To generate developer documentation for nvdaHelper: [Doxygen Windows installer](http://www.doxygen.nl/download.html), version 1.8.15:
96
102
@@ -154,6 +160,8 @@ scons dist
154
160
155
161
The build will be created in the dist directory.
156
162
163
+
### Building the installer
164
+
157
165
To create a launcher archive (one executable allowing for installation or portable dist generation), type:
158
166
159
167
```
@@ -162,6 +170,8 @@ scons launcher
162
170
163
171
The archive will be placed in the output directory.
164
172
173
+
### Building the developer documentation
174
+
165
175
To generate the NVDA developer guide, type:
166
176
167
177
```
@@ -179,6 +189,7 @@ scons devDocs_nvdaHelper
179
189
180
190
The documentation will be placed in the `devDocs\nvdaHelper` folder in the output directory.
181
191
192
+
### Generate debug symbols archive
182
193
To generate an archive of debug symbols for the various dll/exe binaries, type:
183
194
184
195
```
@@ -187,12 +198,14 @@ scons symbolsArchive
187
198
188
199
The archive will be placed in the output directory.
189
200
201
+
### Generate translation template
190
202
To generate a gettext translation template (for translators), type:
191
203
192
204
```
193
205
scons pot
194
206
```
195
207
208
+
### Customising the build
196
209
Optionally, the build can be customised by providing variables on the command line:
To run only the translatable string checks (which check that all translatable strings have translator comments), run:
237
251
238
252
```
239
253
scons checkPot
240
254
```
241
255
256
+
### Linting your changes
257
+
In order to ensure your changes comply with NVDA's coding style you can run the Flake8 linter locally.
258
+
Running via SCons will use Flake8 to inspect only the differences between your working directory and the specified `base` branch.
259
+
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`.
260
+
```
261
+
scons lint base=origin/master
262
+
```
263
+
264
+
To be warned about linting errors faster, you may wish to integrate Flake8 other development tools you are using.
Copy file name to clipboardExpand all lines: sconstruct
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,17 @@ vars.Add(ListVariable("nvdaHelperDebugFlags", "a list of debugging features you
76
76
vars.Add(EnumVariable('nvdaHelperLogLevel','The level of logging you wish to see, lower is more verbose','15',allowed_values=[str(x) for x in range(60)]))
77
77
if "tests" in COMMAND_LINE_TARGETS:
78
78
vars.Add("unitTests", "A list of unit tests to run", "")
79
+
if "lint" in COMMAND_LINE_TARGETS:
80
+
vars.Add( # pass through variable that lint is requested
81
+
"doLint",
82
+
"internal use",
83
+
True
84
+
)
85
+
vars.Add(
86
+
"base",
87
+
"Lint is done only on a diff, specify the ref to use as base for the diff.",
88
+
None
89
+
)
79
90
if "systemTests" in COMMAND_LINE_TARGETS:
80
91
vars.Add("filter", "A filter for the name of the system test(s) to run. Wildcards accepted.", "")
print(inArg) # blah # noqa: E261 at least two spaces before inline comment
19
+
return5#blah# noqa: E262 inline comment should start with '# '
20
+
21
+
22
+
# ET126 (flake8-tabs) unexpected number of tabs at start of definition line (expected 2, got 3)
23
+
defthatFunc(
24
+
inArgOverIndented# noqa: ET126
25
+
) ->str:
26
+
# F405 'unknownArg' may be undefined, or defined from star imports: collections
27
+
# F821 undefined name 'unknownArg'
28
+
print(unknownArg) # noqa: F821, F405
29
+
return5
30
+
31
+
32
+
# ET126 (flake8-tabs) unexpected number of tabs at start of definition line (expected 2, got 3)
33
+
# F811 redefinition of unused 'thatFunc' from line 13
34
+
defthatFunc( # noqa: F811
35
+
inArgUnderIndented# noqa: ET126
36
+
) ->str:
37
+
pass
38
+
39
+
40
+
# ET126 (flake8-tabs) unexpected number of tabs at start of definition line (expected 2, got 3)
41
+
defanother(
42
+
argIndents,
43
+
dontMatch# noqa: ET126
44
+
) ->float:
45
+
somethingElse=6# noqa: F841 local variable 'somethingElse' is assigned to but never used
46
+
print(argIndents)
47
+
48
+
49
+
defextremlyLongFunctionName_blahblahblahblahblahblahblahblahblahblahblahlblahblahblahblahblahblahblahblahblahblahblahblahlblah(arg): # noqa: E501 line too long (133 > 110 characters)
50
+
raiseNotImplemented# noqa: F901 'raise NotImplemented' should be 'raise NotImplementedError'
0 commit comments