Skip to content

Commit

Permalink
Merge branch 'main' into fix-flake8-warnings-5
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Sep 26, 2024
2 parents a8fe25a + edea810 commit d445d14
Show file tree
Hide file tree
Showing 5,831 changed files with 2,503,605 additions and 2,005,559 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
30 changes: 30 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
AccessModifierOffset: -4
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
PadOperators: true
AlignEscapedNewlines: Left
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Stroustrup
ForEachMacros:
- DGL_FOREACH_NODE
- DGL_FOREACH_EDGE
- BOOST_FOREACH
IfMacros:
- SORT_DEBUG
MacroBlockBegin: GNO_BEGIN
MacroBlockEnd: GNO_END
SortIncludes: Never
---
Language: ObjC
---
Language: JavaScript
---
Language: Json
64 changes: 64 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[run]
; branch = True
; dynamic_context = test_function
concurrency = multiprocessing,thread
parallel = True
data_file = ${INITIAL_PWD-.}/.coverage
omit =
${INITIAL_PWD-.}/testreport
${INITIAL_PWD-.}/.github/*
${INITIAL_PWD-.}/bin.*/*
${INITIAL_PWD-.}/dist.*/*
**/OBJ.*/*
source =
.
${INITIAL_PWD-.}/
${INITIAL_GISBASE-/usr/local/grass??}/

[paths]
root =
./
${INITIAL_GISBASE-/usr/local/grass??}/
/home/*/install/grass??/
python =
./python/
${INITIAL_GISBASE-/usr/local/grass??}/etc/python/
/home/*/install/grass??/etc/python/
special_d_mon =
./display/d.mon/
${INITIAL_GISBASE-/usr/local/grass??}/etc/d.mon/
/home/*/install/grass??/etc/d.mon/
special_r_in_wms =
./scripts/r.in.wms/
${INITIAL_GISBASE-/usr/local/grass??}/etc/r.in.wms/
/home/*/install/grass??/etc/r.in.wms/


[report]
; Since our file structure isn't an importable package, not all files are found
; This allows to find python files even if there is missing __init__.py files, but is slow
include_namespace_packages = True
skip_covered = False
; Regexes for lines to exclude from consideration
exclude_also =
; Don't complain about missing debug-only code:
def __repr__
if self\.debug

; Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

; Don't complain if non-runnable code isn't run:
; if 0:
; if __name__ == .__main__.:

; Don't complain about abstract methods, they aren't run:
@(abc\.)?abstractmethod

ignore_errors = True
precision = 2

[html]
directory = coverage_html_report
show_contexts = true
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
docker
!docker/testdata
!docker/alpine/grass_tests.sh
.gitignore
.github
.travis
.travis.yml
# Do not copy files from previous compilations
dist.*

# The following git files are needed by GRASS GIS to extract the revision
# during compilation. If you are not using one of the Dockerimages from this
Expand Down
161 changes: 131 additions & 30 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,44 +1,148 @@
[flake8]
ignore =
E203, # whitespace before ':' (Black)
W503, # line break before binary operator (Black)
# whitespace before ':' (Black)
E203,
# line break before binary operator (Black)
W503,

per-file-ignores =
# Files and directories which need fixes or specific exceptions
# Many of these ignores can and should be removed and the problem fixed.
# Quick reference for some of the most common errors
# F403 star import used; unable to detect undefined names
# F405 variable may be undefined, or defined from star imports
# E402 module level import not at top of file
# E501 line too long
# E722 do not use bare 'except'
# W605 invalid escape sequence
# F401 imported but unused
# F821 undefined name 'unicode'
# F841 local variable assigned to but never used
lib/init/grass.py: E501, E722, F821, F841, W605
utils/mkrest.py: E501, W605
utils/gitlog2changelog.py: E722, E712, W605
utils/g.html2man/ggroff.py: W605
man/build_check_rest.py: F403, F405
man/build_full_index_rest.py: F403, F405
man/parser_standard_options.py: F403, F405
man/build_class.py: F403, F405
man/build_class_rest.py: F403, F405
man/build_check.py: F403, F405
man/build_full_index.py: F403, F405
man/build_index.py: F403, F405
man/build_index_rest.py: F403, F405
man/build_keywords.py: F403, F405, E722
man/build_topics.py: F403, F405, E722
# E741 ambiguous variable name 'l'
__init__.py: F401, F403
man/build_html.py: E501
man/build_rest.py: E501
imagery/i.atcorr/create_iwave.py: E501, F632, F821, W293
doc/python/raster_example_ctypes.py: F403, F405
doc/python/vector_example_ctypes.py: F403, F405
doc/python/m.distance.py: F403, F405, E501
imagery/i.atcorr/create_iwave.py: F632, F821, W293
doc/python/m.distance.py: E501
doc/gui/wxpython/example/dialogs.py: F401
doc/gui/wxpython/example/g.gui.example.py: E501
locale/grass_po_stats.py: E122, E128, E231, E401, E501, E722, E741
gui/scripts/d.rast3d.py: E501
gui/scripts/d.wms.py: E501
gui/wxpython/docs/wxgui_sphinx/conf.py: E402, W291
gui/wxpython/gcp/manager.py: E722
gui/wxpython/gui_core/*: E722
gui/wxpython/gui_core/dialogs.py: E722
gui/wxpython/gui_core/forms.py: E722
gui/wxpython/gui_core/ghelp.py: E722
gui/wxpython/gui_core/gselect.py: E722
gui/wxpython/gui_core/widgets.py: E722
gui/wxpython/image2target/*: F841, E722, E265
gui/wxpython/image2target/g.gui.image2target.py: E501, E265, F841
gui/wxpython/iscatt/*: F841, E722, F405, F403
gui/wxpython/lmgr/frame.py: F841, E722
# layertree still includes some formatting issues (it is ignored by Black)
gui/wxpython/lmgr/layertree.py: E722, E266, W504, E225
gui/wxpython/lmgr/workspace.py: F841
gui/wxpython/modules/*: F841, E722
gui/wxpython/nviz/*: F841, E266, E722, F403, F405
gui/wxpython/photo2image/*: F841, E722, E265
gui/wxpython/photo2image/g.gui.photo2image.py: E501, F841
gui/wxpython/psmap/*: F841, E266, E722, F405, F403
gui/wxpython/vdigit/*: F841, E722, F405, F403
gui/wxpython/vnet/*: F841
gui/wxpython/wxgui.py: F841
gui/wxpython/animation/g.gui.animation.py: E501
gui/wxpython/tplot/frame.py: F841, E722
gui/wxpython/tplot/g.gui.tplot.py: E501
gui/wxpython/rdigit/g.gui.rdigit.py: F841
gui/wxpython/iclass/digit.py: F405, F403
gui/wxpython/iclass/frame.py: F405, F403
gui/wxpython/iclass/g.gui.iclass.py: E501
gui/wxpython/iclass/statistics.py: F841, F405, F403
gui/wxpython/wxplot/histogram.py: E722
gui/wxpython/wxplot/profile.py: F841, E722
gui/wxpython/wxplot/base.py: F841, E722
gui/wxpython/location_wizard/dialogs.py: F841
gui/wxpython/location_wizard/wizard.py: E722
gui/wxpython/mapdisp/main.py: E722
gui/wxpython/mapdisp/test_mapdisp.py: E501
gui/wxpython/mapdisp/statusbar.py: F841
gui/wxpython/mapswipe/g.gui.mapswipe.py: E501
gui/wxpython/mapwin/base.py: E722
gui/wxpython/mapwin/buffered.py: E722
gui/wxpython/mapwin/graphics.py: E722
gui/wxpython/startup/locdownload.py: E722, E402
gui/wxpython/timeline/g.gui.timeline.py: E501
gui/wxpython/tools/build_modules_xml.py: E722
gui/wxpython/web_services/cap_interface.py: E501
gui/wxpython/web_services/widgets.py: F841, E402
gui/wxpython/rlisetup/sampling_frame.py: F841
gui/wxpython/rlisetup/wizard.py: E722
# Generated file
gui/wxpython/menustrings.py: E501
# F821 undefined name 'cmp'
# https://github.com/OSGeo/grass/issues/1809
python/grass/pydispatch/saferef.py: F821
# C wrappers call libgis.G_gisinit before importing other modules.
# TODO: Is this really needed?
python/grass/pygrass/vector/__init__.py: E402
python/grass/pygrass/raster/__init__.py: E402
python/grass/gunittest/invoker.py: E721
python/grass/pygrass/vector/__init__.py: E402
python/grass/pygrass/modules/interface/*.py: F401
python/grass/pygrass/modules/grid/*.py: F401
python/grass/pygrass/raster/category.py: E721
python/grass/pygrass/rpc/__init__.py: F401, F403
python/grass/pygrass/utils.py: E402
python/grass/temporal/abstract_space_time_dataset.py: E722
python/grass/temporal/c_libraries_interface.py: E722
python/grass/temporal/core.py: E722
python/grass/temporal/datetime_math.py: E722
python/grass/temporal/spatial_topology_dataset_connector.py: E722
python/grass/temporal/temporal_algebra.py: E722
python/grass/temporal/temporal_granularity.py: E722
python/grass/temporal/temporal_raster_base_algebra.py: E722
python/grass/temporal/temporal_topology_dataset_connector.py: E722
python/grass/temporal/univar_statistics.py: E231
# Current benchmarks/tests are changing sys.path before import.
# Possibly, a different approach should be taken there anyway.
python/grass/pygrass/tests/benchmark.py: E402, F401, F821
# Configuration file for Sphinx:
# Ignoring import/code mix and line length.
python/grass/docs/conf.py: E402
# Files not managed by Black
python/grass/imaging/images2gif.py: E226
# Unused imports in init files
# F401 imported but unused
# F403 star import used; unable to detect undefined names
python/grass/*/__init__.py: F401, F403
python/grass/*/*/__init__.py: F401, F403
python/grass/*/*/*/__init__.py: F401, F403
# E402 module level import not at top of file
scripts/r.in.wms/wms_gdal_drv.py: E722
scripts/r.in.wms/wms_drv.py: E402, E722
scripts/r.in.wms/srs.py: E722
scripts/r.semantic.label/r.semantic.label.py: E501
scripts/v.report/v.report.py: E721
scripts/g.extension/g.extension.py: F841, E722, E501
scripts/v.unpack/v.unpack.py: E722, E501
scripts/v.import/v.import.py: E722, E501
scripts/db.univar/db.univar.py: E501
scripts/d.frame/d.frame.py: E722
scripts/i.pansharpen/i.pansharpen.py: E722, E501
scripts/r.in.srtm/r.in.srtm.py: E722
scripts/r.fillnulls/r.fillnulls.py: E722
scripts/d.rast.edit/d.rast.edit.py: E722
scripts/v.what.strds/v.what.strds.py: E722, E501
# Line too long (esp. module interface definitions)
scripts/*/*.py: E501
temporal/t.rast.to.vect/t.rast.to.vect.py: E501
temporal/t.vect.algebra/t.vect.algebra.py: E501
# ## used (##% key: r etc)
temporal/t.rast.what/t.rast.what.py: E265, E266, E501
# Line too long (esp. module interface definitions)
temporal/*/*.py: E501


max-line-length = 88
# Remember to remove the exclusions from .pre-commit-config.yaml when removing here
exclude =
.git,
__pycache__,
Expand All @@ -55,11 +159,8 @@ exclude =
OBJ.*,
# Test output directory
testreport,
# Have their own configs for now
python/grass,
gui/wxpython,
scripts/*/*.py,
temporal/*/*.py,
# Not yet compliant
python/libgrass_interface_generator,
# No tests checked for now
testsuite,

Expand Down
40 changes: 40 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Format Python code with Black
1aab3bbcff76c12d422e7dffd9aba8277f91cd86
0d9e966dd289753cca91886529e65711eaf863eb
57cb2d4bbe6ce71a8b97fce42dd4da736c18e636
6d4d14afb3845a8ecdcef391f3375d97af4a6a84
7e03dcd6a8d7d96ead53d0f72e57735050dc6c7a
feff8e340f5fec1b52ce066360904f72501e76ce
fd86f50e9a4c9ab37cf501290349790377846b59
ff2c2290d1469972504753e5d1415eba5568e196
e9dfbc4eee6fa14af2f0a8a5e1a7c723b34254db
02bfae03d5db8c80a93a0e340ff3cdcd509a2785
0111b11e8b3aae2c55f20eb1ceea3dc4ee86cee9
# Major C formatting in 2008
8868d4b6868e05345c93032704b7304de04c1daf
# Per-file or per-directory C code formatting
c08f63b1b604acbba275c144b543c5164bc9f432
8eaef1f4e6e9497f469cbb7ab91fe03389a6b49b
f6a73088a9c17b6cce7102c5c3107ab4b41f3b2c
65cc33c61461eb1c96bdc3ded4046cb4a595d736
8b4ccfb47f34da4178bb24df5649fdf0f3ff4857
ec2a8f3659ce91f4f235be2088772afd83e90540
e97de6b8d42dca65fc7a7cb56152c56ec18b24bd
# parser: Use #-space-% to allow writing PEP8-compliant Python code (#1287)
635224115c5ee9c29a9356210c3b03e5511ef6dc
# Format shell/Bash scripts
80bcf7a290a6a1249604b2c8a236154f13e25bfa
a0ccdb551e004a0f68192fb65cfc9be61b2880ed
# Format YAML in GH workflows (#1367)
567fa0643d0ab48de590ffbf0e286a288d359312
# Indent most of C code (#2544)
40b598233c196df1c08a6222da24f2307841d1c5
# ClangFormat (#2709-#2715)
a7a050ce379806297f2d0969ebdcf720a82f651c
8de925f87be22a5c943f2969a2872a288d72f2f7
e0fe05696358cd50205279d4129f1d15934fae39
b5a70ba2c4d3115656baa764ff51a31bd5a8db19
9da16f1c51d90d88cd0e1d06e7ae368bbab7a15a
5546e0172d7dad1e3ee248aec3fe00eeebbb3ab3
1ca8e8643fdf94679e95f2fda1019637e02ec7d2
cdd84c130cea04b204479e2efdc75c742efc4843
3 changes: 2 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
custom: https://www.paypal.com/pools/c/86YKZiIEPV
---
open_collective: grass/contribute
31 changes: 15 additions & 16 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,35 @@ assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.
## Describe the bug
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
Steps to reproduce the behavior:
## To reproduce
<!-- Describe the steps to reproduce the behavior, e.g.:
1. Go to '...'
2. Click on '...'
3. Compute '...'
4. See error
-->

**Expected behavior**
A clear and concise description of what you expected to happen.
## Expected behavior
<!-- If not obvious, describe what you expected to happen. -->

**Screenshots**
If applicable, add screenshots to help explain your problem.

**System description (please complete the following information):**
## Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

## System description
<!--
- Operating System: [e.g. Windows, Linux, ..., incl. version]
- GRASS GIS version [e.g. 7.8.4]

<!---
- GRASS GIS version: [e.g. 4.0]
- details about further software components
- run `g.version -rge` in a GRASS GIS terminal session or check in
the GUI menu "Help > About"
- run `python3 -c "import sys, wx; print(sys.version); print(wx.version())"`
to print the Python and wxPython version numbers
--->
-->

**Additional context**
Add any other context about the problem here.
## Additional context
<!-- Add any other context about the problem. -->
Loading

0 comments on commit d445d14

Please sign in to comment.