Skip to content

Commit daa7fb4

Browse files
committed
Update versions of tools by pre-commit
1 parent 2acbd45 commit daa7fb4

File tree

359 files changed

+2685
-3677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+2685
-3677
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
files: \.(h|cpp|hpp|c)$
99

1010
- repo: https://github.com/psf/black
11-
rev: 22.3.0
11+
rev: 26.1.0
1212
hooks:
1313
- id: black
1414
exclude: >
@@ -20,7 +20,7 @@ repos:
2020
autotest/ogr/data/
2121
)
2222
- repo: https://github.com/timothycrosley/isort
23-
rev: 5.12.0
23+
rev: 7.0.0
2424
hooks:
2525
- id: isort
2626
exclude: >
@@ -32,7 +32,7 @@ repos:
3232
autotest/ogr/data/
3333
)
3434
- repo: https://github.com/pycqa/flake8
35-
rev: 7.0.0
35+
rev: 7.3.0
3636
hooks:
3737
- id: flake8
3838
exclude: >
@@ -45,7 +45,7 @@ repos:
4545
autotest/ogr/data/
4646
)
4747
- repo: https://github.com/pre-commit/mirrors-clang-format
48-
rev: 'v15.0.7'
48+
rev: 'v21.1.8'
4949
hooks:
5050
- id: clang-format
5151
exclude: >

alg/delaunay.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,11 @@ int GDALTriangulationComputeBarycentricCoefficients(GDALTriangulation *psDT,
348348
/************************************************************************/
349349

350350
#define BARYC_COORD_L1(psCoeffs, dfX, dfY) \
351-
(psCoeffs->dfMul1X * ((dfX)-psCoeffs->dfCstX) + \
352-
psCoeffs->dfMul1Y * ((dfY)-psCoeffs->dfCstY))
351+
(psCoeffs->dfMul1X * ((dfX) - psCoeffs->dfCstX) + \
352+
psCoeffs->dfMul1Y * ((dfY) - psCoeffs->dfCstY))
353353
#define BARYC_COORD_L2(psCoeffs, dfX, dfY) \
354-
(psCoeffs->dfMul2X * ((dfX)-psCoeffs->dfCstX) + \
355-
psCoeffs->dfMul2Y * ((dfY)-psCoeffs->dfCstY))
354+
(psCoeffs->dfMul2X * ((dfX) - psCoeffs->dfCstX) + \
355+
psCoeffs->dfMul2Y * ((dfY) - psCoeffs->dfCstY))
356356
#define BARYC_COORD_L3(l1, l2) (1 - (l1) - (l2))
357357

358358
/** Computes the barycentric coordinates of a point.

alg/gdal_crs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ struct MATRIX
585585

586586
/* CALCULATE OFFSET INTO ARRAY BASED ON R/C */
587587

588-
#define M(row, col) m->v[(((row)-1) * (m->n)) + (col)-1]
588+
#define M(row, col) m->v[(((row) - 1) * (m->n)) + (col) - 1]
589589

590590
/************************************************************************/
591591
/* FUNCTION PROTOTYPES FOR STATIC (INTERNAL) FUNCTIONS */

alg/gdalgrid.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ CPLErr GDALGridInverseDistanceToAPowerNearestNeighbor(
245245
{
246246
CPL_IGNORE_RET_VAL(nPoints);
247247

248-
const GDALGridInverseDistanceToAPowerNearestNeighborOptions
249-
*const poOptions = static_cast<
248+
const GDALGridInverseDistanceToAPowerNearestNeighborOptions *const
249+
poOptions = static_cast<
250250
const GDALGridInverseDistanceToAPowerNearestNeighborOptions *>(
251251
poOptionsIn);
252252
const double dfRadius = poOptions->dfRadius;
@@ -352,8 +352,8 @@ static CPLErr GDALGridInverseDistanceToAPowerNearestNeighborPerQuadrant(
352352
const double *padfY, const double *padfZ, double dfXPoint, double dfYPoint,
353353
double *pdfValue, void *hExtraParamsIn)
354354
{
355-
const GDALGridInverseDistanceToAPowerNearestNeighborOptions
356-
*const poOptions = static_cast<
355+
const GDALGridInverseDistanceToAPowerNearestNeighborOptions *const
356+
poOptions = static_cast<
357357
const GDALGridInverseDistanceToAPowerNearestNeighborOptions *>(
358358
poOptionsIn);
359359
const double dfRadius = poOptions->dfRadius;
@@ -2609,7 +2609,7 @@ static int GDALGridProgressMonoThread(GDALGridJob *psJob)
26092609
static void GDALGridJobProcess(void *user_data)
26102610
{
26112611
GDALGridJob *const psJob = static_cast<GDALGridJob *>(user_data);
2612-
int (*pfnProgress)(GDALGridJob * psJob) = psJob->pfnProgress;
2612+
int (*pfnProgress)(GDALGridJob *psJob) = psJob->pfnProgress;
26132613
const GUInt32 nXSize = psJob->nXSize;
26142614

26152615
/* -------------------------------------------------------------------- */
@@ -3862,8 +3862,8 @@ CPLErr GDALGridParseAlgorithmAndOptions(const char *pszAlgorithm,
38623862
*ppOptions = CPLMalloc(
38633863
sizeof(GDALGridInverseDistanceToAPowerNearestNeighborOptions));
38643864

3865-
GDALGridInverseDistanceToAPowerNearestNeighborOptions
3866-
*const poPowerOpts = static_cast<
3865+
GDALGridInverseDistanceToAPowerNearestNeighborOptions *const
3866+
poPowerOpts = static_cast<
38673867
GDALGridInverseDistanceToAPowerNearestNeighborOptions *>(
38683868
*ppOptions);
38693869

alg/gdalwarpkernel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4366,9 +4366,9 @@ static bool GWKResampleOptimizedLanczos(const GDALWarpKernel *poWK, int iBand,
43664366
else
43674367
padfWeightsXShifted[i] = padfCst[(i + 3) % 3] / (dfX * dfX);
43684368
#if DEBUG_VERBOSE
4369-
// TODO(schwehr): AlmostEqual.
4370-
// CPLAssert(fabs(padfWeightsX[i-poWK->nFiltInitX] -
4371-
// GWKLanczosSinc(dfX, 3.0)) < 1e-10);
4369+
// TODO(schwehr): AlmostEqual.
4370+
// CPLAssert(fabs(padfWeightsX[i-poWK->nFiltInitX] -
4371+
// GWKLanczosSinc(dfX, 3.0)) < 1e-10);
43724372
#endif
43734373
}
43744374

@@ -4483,9 +4483,9 @@ static bool GWKResampleOptimizedLanczos(const GDALWarpKernel *poWK, int iBand,
44834483
else
44844484
padfWeightsYShifted[j] = padfCst[(j + 3) % 3] / (dfY * dfY);
44854485
#if DEBUG_VERBOSE
4486-
// TODO(schwehr): AlmostEqual.
4487-
// CPLAssert(fabs(padfWeightsYShifted[j] -
4488-
// GWKLanczosSinc(dfY, 3.0)) < 1e-10);
4486+
// TODO(schwehr): AlmostEqual.
4487+
// CPLAssert(fabs(padfWeightsYShifted[j] -
4488+
// GWKLanczosSinc(dfY, 3.0)) < 1e-10);
44894489
#endif
44904490
}
44914491

alg/llrasterize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,6 @@ void GDALdllImageLineAllTouched(
742742
dfVariant += dfDeltaVariant * dfStepX;
743743
}
744744
} // Next step along segment.
745-
} // Next segment.
746-
} // Next part.
745+
} // Next segment.
746+
} // Next part.
747747
}

alg/viewshed/cumulative.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ bool Cumulative::run(const std::string &srcFilename,
7878
CPLWorkerThreadPool executorPool(numThreads);
7979
for (int i = 0; i < numThreads; ++i)
8080
executorPool.SubmitJob(
81-
[this, &srcFilename, &progress, &err, &running, &hasFoundNoData] {
81+
[this, &srcFilename, &progress, &err, &running, &hasFoundNoData]
82+
{
8283
runExecutor(srcFilename, progress, err, running,
8384
hasFoundNoData);
8485
});

alg/viewshed/viewshed_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct Options
7878
90.0}; //!< maximum pitch (vertical angle) of observable points
7979
double curveCoeff{.85714}; //!< coefficient for atmospheric refraction
8080
OutputMode outputMode{OutputMode::Normal}; //!< Output information.
81-
//!< Normal, Height from DEM or Height from ground
81+
//!< Normal, Height from DEM or Height from ground
8282
std::string outputFormat{}; //!< output raster format
8383
std::string outputFilename{}; //!< output raster filename
8484
CPLStringList creationOpts{}; //!< options for output raster creation

apps/gdal2ogr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ int main(int argc, char *argv[])
258258
padfBuffer = (double *)CPLMalloc(nXSize * sizeof(double));
259259

260260
#define GET_X(j, i) \
261-
adfGeotransform[0] + (j)*adfGeotransform[1] + (i)*adfGeotransform[2]
261+
adfGeotransform[0] + (j) * adfGeotransform[1] + (i) * adfGeotransform[2]
262262
#define GET_Y(j, i) \
263-
adfGeotransform[3] + (j)*adfGeotransform[4] + (i)*adfGeotransform[5]
263+
adfGeotransform[3] + (j) * adfGeotransform[4] + (i) * adfGeotransform[5]
264264
#define GET_XY(j, i) GET_X(j, i), GET_Y(j, i)
265265

266266
/* -------------------------------------------------------------------- */

apps/gdal_rasterize_lib.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ GDALRasterizeOptionsGetParser(GDALRasterizeOptions *psOptions,
105105
argParser->add_argument("-at")
106106
.flag()
107107
.action(
108-
[psOptions](const std::string &) {
108+
[psOptions](const std::string &)
109+
{
109110
psOptions->aosRasterizeOptions.SetNameValue("ALL_TOUCHED",
110111
"TRUE");
111112
})
@@ -135,7 +136,8 @@ GDALRasterizeOptionsGetParser(GDALRasterizeOptions *psOptions,
135136
.flag()
136137
.store_into(psOptions->b3D)
137138
.action(
138-
[psOptions](const std::string &) {
139+
[psOptions](const std::string &)
140+
{
139141
psOptions->aosRasterizeOptions.SetNameValue(
140142
"BURN_VALUE_FROM", "Z");
141143
})
@@ -146,7 +148,8 @@ GDALRasterizeOptionsGetParser(GDALRasterizeOptions *psOptions,
146148
argParser->add_argument("-add")
147149
.flag()
148150
.action(
149-
[psOptions](const std::string &) {
151+
[psOptions](const std::string &)
152+
{
150153
psOptions->aosRasterizeOptions.SetNameValue("MERGE_ALG", "ADD");
151154
})
152155
.help(_("Instead of burning a new value, this adds the new value to "
@@ -157,7 +160,8 @@ GDALRasterizeOptionsGetParser(GDALRasterizeOptions *psOptions,
157160
.flag()
158161
.hidden()
159162
.action(
160-
[psOptions](const std::string &s) {
163+
[psOptions](const std::string &s)
164+
{
161165
psOptions->aosRasterizeOptions.SetNameValue("CHUNKYSIZE",
162166
s.c_str());
163167
});
@@ -286,7 +290,8 @@ GDALRasterizeOptionsGetParser(GDALRasterizeOptions *psOptions,
286290
argParser->add_argument("-optim")
287291
.metavar("AUTO|VECTOR|RASTER")
288292
.action(
289-
[psOptions](const std::string &s) {
293+
[psOptions](const std::string &s)
294+
{
290295
psOptions->aosRasterizeOptions.SetNameValue("OPTIM", s.c_str());
291296
})
292297
.help(_("Force the algorithm used."));

0 commit comments

Comments
 (0)