Skip to content

Commit

Permalink
Merge branch 'main' into fix-flask8-e402-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharansrj567 authored Jan 16, 2024
2 parents ea17773 + 4c6be3e commit 9a36b7e
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 65 deletions.
90 changes: 44 additions & 46 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,121 +2,120 @@
libraries:
- changed-files:
- any-glob-to-any-file:
- lib/**/*
- include/grass/*
- include/grass/**/*
- python/**/*
- lib/**
- include/grass/**
- python/**
module:
- changed-files:
- any-glob-to-any-file:
- db/**/*
- display/**/*
- general/**/*
- imagery/**/*
- misc/**/*
- ps/**/*
- raster/**/*
- raster3d/**/*
- scripts/**/*
- temporal/**/*
- vector/**/*
- db/**
- display/**
- general/**
- imagery/**
- misc/**
- ps/**
- raster/**
- raster3d/**
- scripts/**
- temporal/**
- vector/**

# Module categories
database:
- changed-files:
- any-glob-to-any-file:
- db/**/*
- lib/db/**/*
- db/**
- lib/db/**
- scripts/db.*/**
- '**.sql'
display:
- changed-files:
- any-glob-to-any-file:
- display/**/*
- lib/display/**/*
- display/**
- lib/display/**
- scripts/d.*/**
general:
- changed-files:
- any-glob-to-any-file:
- general/**/*
- general/**
- scripts/g.*/**
GUI:
- changed-files:
- any-glob-to-any-file:
- gui/**/*
- gui/**
imagery:
- changed-files:
- any-glob-to-any-file:
- imagery/**/*
- lib/imagery/**/*
- imagery/**
- lib/imagery/**
- scripts/i.*/**
misc:
- changed-files:
- any-glob-to-any-file:
- misc/**/*
- misc/**
- scripts/m.*/**
raster:
- changed-files:
- any-glob-to-any-file:
- raster/**/*
- lib/raster/**/*
- raster/**
- lib/raster/**
- scripts/r.*/**
raster3d:
- changed-files:
- any-glob-to-any-file:
- raster3d/**/*
- lib/raster3d/**/*
- raster3d/**
- lib/raster3d/**
- scripts/r3.*/**
temporal:
- changed-files:
- any-glob-to-any-file:
- temporal/**/*
- lib/temporal/**/*
- temporal/**
- lib/temporal/**
- scripts/t.*/**
vector:
- changed-files:
- any-glob-to-any-file:
- vector/**/*
- lib/vector/**/*
- vector/**
- lib/vector/**
- scripts/v.*/**

# Build, packaging, or OS related
CI:
- changed-files:
- any-glob-to-any-file:
- .github/**/*
- .travis/**/*
- .github/**
- .travis/**
- binder/**
- .travis.yml
- renovate.json
- .pre-commit-config.yaml
Windows:
- changed-files:
- any-glob-to-any-file:
- mswindows/**/*
- mswindows/**
macOS:
- changed-files:
- any-glob-to-any-file:
- macosx/**/*
- macosx/**
Linux:
- changed-files:
- any-glob-to-any-file:
- singularity/**/*
- singularity/**
- rpm/**
docker:
- changed-files:
- any-glob-to-any-file:
- docker/**/*
- docker/**
- '**/*Dockerfile*'
- '**/*dockerfile*'
- '*Dockerfile*'
- '*dockerfile*'
- .dockerignore

docs:
- all:
- changed-files:
- any-glob-to-any-file:
- doc/**/*
- man/**/*
- doc/**
- man/**
- '**/*.md'
- '**/*.rst'
- '**/*.html'
Expand All @@ -129,22 +128,21 @@ docs:
- NEWS
- TODO
- all-globs-to-all-files:
- '!doc/development/rfc/*'
- '!doc/development/rfc/**'
RFC:
- changed-files:
- any-glob-to-any-file:
- doc/development/rfc/*
- doc/development/rfc/**
translation:
- changed-files:
- any-glob-to-any-file: locale/**/*
- any-glob-to-any-file: locale/**

# based on file types
Python:
- changed-files:
- any-glob-to-any-file:
- '**/*.py'
- '**/pyproject.toml'
- 'pyproject.toml'
C:
- changed-files:
- any-glob-to-any-file: '**/*.c'
Expand Down
49 changes: 36 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,72 @@ on:
# Check every Saturday at 18:36
- cron: 36 18 * * 6

permissions: {}

jobs:
analyze:
name: ${{ matrix.language }}
name: Analyze
runs-on: ubuntu-22.04
permissions:
security-events: write
actions: read
contents: read

strategy:
fail-fast: false
matrix:
# C is included in cpp, no separate C language available on CodeQL
language:
- cpp
- c-cpp
- python

concurrency:
group: ${{ github.workflow }}-${{
github.event_name == 'pull_request' &&
github.head_ref || github.sha }}-${{ matrix.language }}
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml

- name: Get dependencies
python-version: '3.x'
- name: Install non-Python dependencies
if: ${{ matrix.language == 'c-cpp' }}
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
setup-python-dependencies: false

- name: Create installation directory
run: |
mkdir $HOME/install
mkdir "${HOME}/install"
- name: Set LD_LIBRARY_PATH for compilation
run: |
echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${HOME}/install/lib" >> $GITHUB_ENV
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Build
if: ${{ matrix.language == 'c-cpp' }}
env:
CFLAGS: -std=gnu11
CXXFLAGS: -std=c++11
run: .github/workflows/build_ubuntu-22.04.sh $HOME/install
run: .github/workflows/build_ubuntu-22.04.sh "${HOME}/install"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
11 changes: 5 additions & 6 deletions lib/imagery/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int I_get_group(char *group)
G_suppress_warnings(0);
if (fd == NULL)
return 0;
stat = (fscanf(fd, "%s", group) == 1);
stat = (fscanf(fd, "%255s", group) == 1);
fclose(fd);
return stat;
}
Expand Down Expand Up @@ -77,7 +77,7 @@ int I_get_subgroup(const char *group, char *subgroup)
G_suppress_warnings(0);
if (fd == NULL)
return 0;
stat = (fscanf(fd, "%s", subgroup) == 1);
stat = (fscanf(fd, "%255s", subgroup) == 1);
fclose(fd);
return stat;
}
Expand Down Expand Up @@ -174,7 +174,6 @@ int I_get_subgroup_ref2(const char *group, const char *subgroup,
static int get_ref(const char *group, const char *subgroup, const char *gmapset,
struct Ref *ref)
{
int n;
char buf[1024];
char name[INAME_LEN], mapset[INAME_LEN];
char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
Expand All @@ -200,8 +199,8 @@ static int get_ref(const char *group, const char *subgroup, const char *gmapset,
return 0;

while (G_getl2(buf, sizeof buf, fd)) {
n = sscanf(buf, "%255s %255s %15s", name, mapset,
color); /* better use INAME_LEN */
int n = sscanf(buf, "%255s %255s %15s", name, mapset,
color); /* better use INAME_LEN */
if (n == 2 || n == 3) {
I_add_file_to_group_ref(name, mapset, ref);
if (n == 3)
Expand Down Expand Up @@ -262,7 +261,7 @@ int I_init_ref_color_nums(struct Ref *ref)
ref->blu.index = NULL;

if (ref->nfiles <= 0 || ref->red.n >= 0 || ref->blu.n >= 0 ||
ref->blu.n >= 0)
ref->grn.n >= 0)
return 1;
switch (ref->nfiles) {
case 1:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9a36b7e

Please sign in to comment.