.flake8 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. [flake8]
  2. ignore =
  3. E203, # whitespace before ':' (Black)
  4. W503, # line break before binary operator (Black)
  5. per-file-ignores =
  6. # Files and directories which need fixes or specific exceptions
  7. # Many of these ignores can and should be removed and the problem fixed.
  8. # Quick reference for some of the most common errors
  9. # F403 star import used; unable to detect undefined names
  10. # F405 variable may be undefined, or defined from star imports
  11. # E402 module level import not at top of file
  12. # E501 line too long
  13. # E722 do not use bare 'except'
  14. # W605 invalid escape sequence
  15. # F401 imported but unused
  16. # F821 undefined name 'unicode'
  17. # F841 local variable assigned to but never used
  18. # E741 ambiguous variable name 'l'
  19. lib/init/grass.py: E501, E722, F821, F841, W605
  20. utils/mkrest.py: E501, W605
  21. utils/gitlog2changelog.py: E722, E712, W605
  22. utils/g.html2man/ggroff.py: W605
  23. man/build_check_rest.py: F403, F405
  24. man/build_full_index_rest.py: F403, F405
  25. man/parser_standard_options.py: F403, F405
  26. man/build_class.py: F403, F405
  27. man/build_class_rest.py: F403, F405
  28. man/build_check.py: F403, F405
  29. man/build_full_index.py: F403, F405
  30. man/build_index.py: F403, F405
  31. man/build_index_rest.py: F403, F405
  32. man/build_keywords.py: F403, F405, E722
  33. man/build_topics.py: F403, F405, E722
  34. man/build_html.py: E501
  35. man/build_rest.py: E501
  36. imagery/i.atcorr/create_iwave.py: E501, F632, F821, W293
  37. doc/python/raster_example_ctypes.py: F403, F405
  38. doc/python/vector_example_ctypes.py: F403, F405
  39. doc/python/m.distance.py: F403, F405, E501
  40. doc/gui/wxpython/example/dialogs.py: F401
  41. doc/gui/wxpython/example/g.gui.example.py: E501
  42. locale/grass_po_stats.py: E122, E128, E231, E401, E501, E722, E741
  43. gui/scripts/d.rast3d.py: E501
  44. gui/scripts/d.wms.py: E501
  45. gui/wxpython/core/debug.py: E501
  46. gui/wxpython/core/gcmd.py: E402, E501
  47. gui/wxpython/core/giface.py: E501
  48. gui/wxpython/core/gthread.py: F841
  49. gui/wxpython/core/gconsole.py: E722, W605
  50. gui/wxpython/core/toolboxes.py: E722, E501
  51. gui/wxpython/core/utils.py: E722, F841, W605
  52. gui/wxpython/core/workspace.py: E722, E501
  53. gui/wxpython/core/render.py: E722, F841, E501
  54. gui/wxpython/core/ws.py: F841, E501
  55. gui/wxpython/core/settings.py: E722
  56. gui/wxpython/datacatalog/tree.py: E731, E402, E501
  57. gui/wxpython/dbmgr/base.py: E501, E722, F841
  58. gui/wxpython/dbmgr/dialogs.py: E501, F841, E722
  59. gui/wxpython/dbmgr/sqlbuilder.py: E501, E722, F841
  60. gui/wxpython/dbmgr/manager.py: E501, E722
  61. gui/wxpython/dbmgr/vinfo.py: F841
  62. gui/wxpython/docs/wxgui_sphinx/conf.py: E402, E501
  63. gui/wxpython/gcp/g.gui.gcp.py: F841
  64. gui/wxpython/gcp/manager.py: E501, F841, E722
  65. gui/wxpython/gcp/mapdisplay.py: F841
  66. gui/wxpython/gmodeler/*: F841, E722, W605, F405, F403, E402
  67. gui/wxpython/gui_core/*: F841, E266, E722, W605
  68. gui/wxpython/gui_core/dialogs.py: E501, E722, F841, W605
  69. gui/wxpython/gui_core/forms.py: E501, E722, F841
  70. gui/wxpython/gui_core/ghelp.py: E501, E722
  71. gui/wxpython/gui_core/gselect.py: E501, F841, E266, E722
  72. gui/wxpython/gui_core/preferences.py: E501, E266, F841
  73. gui/wxpython/gui_core/treeview.py: E501, F841
  74. gui/wxpython/gui_core/widgets.py: E501, F841, E722, E266
  75. gui/wxpython/image2target/*: F841, E722, E265, E501
  76. gui/wxpython/iscatt/*: F841, E722, E741, F405, F403, E501
  77. gui/wxpython/lmgr/giface.py: E501, E741
  78. gui/wxpython/lmgr/frame.py: F841, E722, W605, E501
  79. # layertree still includes some formatting issues (it is ignored by Black)
  80. gui/wxpython/lmgr/layertree.py: E722, E266, W504, E225, E501
  81. gui/wxpython/lmgr/workspace.py: F841
  82. gui/wxpython/modules/*: F841, E722, W605, E501
  83. gui/wxpython/nviz/*: F841, E266, E722, W605, F403, F405, E501
  84. gui/wxpython/photo2image/*: F841, E722, E265, E501
  85. gui/wxpython/psmap/*: F841, E266, E722, F405, F403, E501
  86. gui/wxpython/vdigit/*: F841, E722, E741, F405, F403, E501
  87. gui/wxpython/vnet/*: F841, E501
  88. gui/wxpython/wxgui.py: F841
  89. gui/wxpython/animation/g.gui.animation.py: E501
  90. gui/wxpython/animation/mapwindow.py: F841
  91. gui/wxpython/animation/provider.py: F841, E501
  92. gui/wxpython/animation/temporal_manager.py: E501
  93. gui/wxpython/tplot/frame.py: F841, E722
  94. gui/wxpython/tplot/g.gui.tplot.py: E501
  95. gui/wxpython/rdigit/g.gui.rdigit.py: F841
  96. gui/wxpython/rdigit/toolbars.py: E501
  97. gui/wxpython/iclass/dialogs.py: E741, E501
  98. gui/wxpython/iclass/digit.py: F405, F403
  99. gui/wxpython/iclass/frame.py: F405, F403, E501
  100. gui/wxpython/iclass/g.gui.iclass.py: E501
  101. gui/wxpython/iclass/statistics.py: F841, F405, F403
  102. gui/wxpython/wxplot/dialogs.py: E501
  103. gui/wxpython/wxplot/histogram.py: E722
  104. gui/wxpython/wxplot/profile.py: F841, E722
  105. gui/wxpython/wxplot/base.py: F841, E722
  106. gui/wxpython/wxplot/scatter.py: E501
  107. gui/wxpython/location_wizard/dialogs.py: F841, E501
  108. gui/wxpython/location_wizard/wizard.py: E722
  109. gui/wxpython/mapdisp/frame.py: E501
  110. gui/wxpython/mapdisp/main.py: E722, E501
  111. gui/wxpython/mapdisp/test_mapdisp.py: E501
  112. gui/wxpython/mapdisp/toolbars.py: E501
  113. gui/wxpython/mapdisp/statusbar.py: F841, E501
  114. gui/wxpython/mapswipe/g.gui.mapswipe.py: E501
  115. gui/wxpython/mapwin/base.py: E722, E501
  116. gui/wxpython/mapwin/buffered.py: E722, E501
  117. gui/wxpython/mapwin/decorations.py: E501
  118. gui/wxpython/mapwin/graphics.py: E722
  119. gui/wxpython/startup/locdownload.py: E722, E402, E501
  120. gui/wxpython/timeline/g.gui.timeline.py: E501
  121. gui/wxpython/tools/build_modules_xml.py: E722, E501
  122. gui/wxpython/web_services/cap_interface.py: E501
  123. gui/wxpython/web_services/dialogs.py: E501
  124. gui/wxpython/web_services/widgets.py: F841, E741, W605, E402, E501
  125. gui/wxpython/rlisetup/frame.py: E741
  126. gui/wxpython/rlisetup/sampling_frame.py: F841
  127. gui/wxpython/rlisetup/wizard.py: E722, E741
  128. # Generated file
  129. gui/wxpython/menustrings.py: E501
  130. # F821 undefined name 'cmp'
  131. # https://github.com/OSGeo/grass/issues/1809
  132. python/grass/pydispatch/saferef.py: F821
  133. # C wrappers call libgis.G_gisinit before importing other modules.
  134. # TODO: Is this really needed?
  135. python/grass/pygrass/vector/__init__.py: E402,
  136. python/grass/pygrass/raster/__init__.py: E402,
  137. python/grass/gunittest/*.py: E501 # These are mainly just todo comments
  138. python/grass/gunittest/gmodules.py: E501, W605
  139. python/grass/pygrass/vector/geometry.py: W605
  140. python/grass/pygrass/vector/table.py: E501
  141. python/grass/pygrass/vector/__init__.py: E501, E402
  142. python/grass/pygrass/modules/interface/*.py: E501, F401
  143. python/grass/pygrass/modules/interface/module.py: E501, W605
  144. python/grass/pygrass/modules/interface/parameter.py: E501, W605
  145. python/grass/pygrass/modules/grid/*.py: E501, F401
  146. python/grass/pygrass/raster/*.py: E501
  147. python/grass/pygrass/raster/rowio.py: E741
  148. python/grass/pygrass/rpc/__init__.py: E501, F401, F403
  149. python/grass/pygrass/utils.py: E402, E501
  150. python/grass/script/db.py: E501
  151. python/grass/script/task.py: W605
  152. python/grass/script/vector.py: E501 # Long doctest lines which need review anyway
  153. python/grass/temporal/abstract_map_dataset.py: E501
  154. python/grass/temporal/abstract_space_time_dataset.py: W605, E501, F841, E722
  155. python/grass/temporal/aggregation.py: E501
  156. python/grass/temporal/base.py: E501
  157. python/grass/temporal/c_libraries_interface.py: E501, F841, E722
  158. python/grass/temporal/core.py: E501, E722
  159. python/grass/temporal/datetime_math.py: E501, F841, E722
  160. python/grass/temporal/list_stds.py: E501
  161. python/grass/temporal/metadata.py: E501
  162. python/grass/temporal/open_stds.py: F841
  163. python/grass/temporal/register.py: E501
  164. python/grass/temporal/space_time_datasets.py: E501
  165. python/grass/temporal/spatial_extent.py: E501
  166. python/grass/temporal/spatial_topology_dataset_connector.py: E501, E722
  167. python/grass/temporal/spatio_temporal_relationships.py: E501
  168. python/grass/temporal/temporal_algebra.py: E741, E501, F841, E722
  169. python/grass/temporal/temporal_extent.py: E501
  170. python/grass/temporal/temporal_granularity.py: E501, F841, E722
  171. python/grass/temporal/temporal_operator.py: E501
  172. python/grass/temporal/temporal_raster_algebra.py: E741
  173. python/grass/temporal/temporal_raster_base_algebra.py: E501, F841, E722
  174. python/grass/temporal/temporal_raster3d_algebra.py: E741
  175. python/grass/temporal/temporal_topology_dataset_connector.py: E501, E722
  176. python/grass/temporal/temporal_vector_algebra.py: E741, E501, F841
  177. python/grass/temporal/univar_statistics.py: E501
  178. # Current benchmarks/tests are changing sys.path before import.
  179. # Possibly, a different approach should be taken there anyway.
  180. python/grass/pygrass/tests/benchmark.py: E501, E402, F401, F821
  181. # Configuration file for Sphinx:
  182. # Ignoring import/code mix and line length.
  183. python/grass/docs/conf.py: E402, E501,
  184. # Files not managed by Black
  185. python/grass/imaging/images2gif.py: E226, E501
  186. # Unused imports in init files
  187. # F401 imported but unused
  188. # F403 star import used; unable to detect undefined names
  189. python/grass/*/__init__.py: F401, F403
  190. python/grass/*/*/__init__.py: F401, F403
  191. python/grass/*/*/*/__init__.py: F401, F403
  192. # E402 module level import not at top of file
  193. scripts/d.polar/d.polar.py: F841, E501
  194. scripts/r.in.wms/wms_gdal_drv.py: F841, E722, E501
  195. scripts/r.in.wms/wms_cap_parsers.py: F841, E741, E501
  196. scripts/r.in.wms/wms_drv.py: E402, E722, E501
  197. scripts/r.in.wms/srs.py: E722, E501
  198. scripts/r.semantic.label/r.semantic.label.py: F841, E501
  199. scripts/v.report/v.report.py: F841, E501
  200. scripts/db.out.ogr/db.out.ogr.py: F841
  201. scripts/g.extension/g.extension.py: F841, E722, E501
  202. scripts/r.unpack/r.unpack.py: E722, E501
  203. scripts/v.unpack/v.unpack.py: F841, E722, E501
  204. scripts/v.import/v.import.py: F841, E722, E501
  205. scripts/db.univar/db.univar.py: E741, E501
  206. scripts/d.rast.leg/d.rast.leg.py: E741
  207. scripts/d.frame/d.frame.py: E722, E501
  208. scripts/i.pansharpen/i.pansharpen.py: E722, E501
  209. scripts/r.in.srtm/r.in.srtm.py: E722, E501
  210. scripts/r.fillnulls/r.fillnulls.py: E722, E501
  211. scripts/d.rast.edit/d.rast.edit.py: E722, E501
  212. scripts/v.what.strds/v.what.strds.py: E722, E501
  213. scripts/i.in.spotvgt/i.in.spotvgt.py: E722, E501
  214. # Line too long (esp. module interface definitions)
  215. scripts/*/*.py: E501
  216. # local variable 'column' is assigned to but never used
  217. temporal/t.rast.to.vect/t.rast.to.vect.py: F841, E501
  218. # local variable 'stdstype' is assigned to but never used
  219. temporal/t.vect.algebra/t.vect.algebra.py: F841, E501
  220. # ## used (##% key: r etc)
  221. # local variable 'map_list' is assigned to but never used
  222. temporal/t.rast.what/t.rast.what.py: E265, E266, F841, E501
  223. # Line too long (esp. module interface definitions)
  224. temporal/*/*.py: E501
  225. max-line-length = 88
  226. exclude =
  227. .git,
  228. __pycache__,
  229. .env,
  230. .venv,
  231. env,
  232. venv,
  233. ENV,
  234. env.bak,
  235. venv.bak,
  236. # Build directories
  237. bin.*,
  238. dist.*,
  239. OBJ.*,
  240. # Test output directory
  241. testreport,
  242. # Not yet compliant
  243. python/libgrass_interface_generator,
  244. # No tests checked for now
  245. testsuite,
  246. builtins =
  247. _