diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/check.yml similarity index 62% rename from .github/workflows/cppcheck.yml rename to .github/workflows/check.yml index b62f38a2..b7f0b674 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/check.yml @@ -1,34 +1,49 @@ -name: cppcheck-action-test +name: Checks on: pull_request: jobs: - build: - name: cppcheck-test + cppcheck: + name: Cppcheck runs-on: ubuntu-22.04 - steps: + steps: - name: Checkout sources uses: actions/checkout@v4 + with: + path: src/pg_stat_monitor - name: Checkout cppcheck sources uses: actions/checkout@v4 with: - repository: 'danmar/cppcheck' - ref: '2.13.4' + repository: "danmar/cppcheck" + ref: "2.13.4" path: src/cppcheck - name: Build and install cppcheck + working-directory: src/cppcheck run: | mkdir build cd build cmake .. cmake --build . sudo cmake --install . - working-directory: src/cppcheck - name: Execute linter check with cppcheck + working-directory: src/pg_stat_monitor run: | set -x cppcheck --enable=all --inline-suppr --template='{file}:{line},{severity},{id},{message}' --error-exitcode=1 --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression:pg_stat_monitor.c --check-config . + license: + name: License + runs-on: ubuntu-22.04 + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Check license headers + uses: apache/skywalking-eyes/header@v0.6.0 + with: + token: "" # Prevent comments diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000..06a52691 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,19 @@ +header: + paths: + - "**/*.c" + - "**/*.h" + license: + pattern: | + .*\.(c|h) + .* + + Portions Copyright © 2018-2024, Percona LLC and/or its affiliates + + Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group + + Portions Copyright (c) 1994, The Regents of the University of California + + IDENTIFICATION + contrib/pg_stat_monitor/.*\.(c|h) + + comment: never diff --git a/guc.c b/guc.c index c98d3ce3..25823d88 100644 --- a/guc.c +++ b/guc.c @@ -1,14 +1,14 @@ /*------------------------------------------------------------------------- * - * guc.c: guc variable handling of pg_stat_monitor + * guc.c + * guc variable handling of pg_stat_monitor * - * Portions Copyright © 2018-2020, Percona LLC and/or its affiliates + * Portions Copyright © 2018-2024, Percona LLC and/or its affiliates * - * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * Portions Copyright (c) 1994, The Regents of the University of California * - * * IDENTIFICATION * contrib/pg_stat_monitor/guc.c * diff --git a/hash_query.c b/hash_query.c index c18e20ff..ff34a4cf 100644 --- a/hash_query.c +++ b/hash_query.c @@ -1,11 +1,11 @@ /*------------------------------------------------------------------------- * * hash_query.c - * Track statement execution times across a whole database cluster. + * Track statement execution times across a whole database cluster. * - * Portions Copyright © 2018-2020, Percona LLC and/or its affiliates + * Portions Copyright © 2018-2024, Percona LLC and/or its affiliates * - * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * Portions Copyright (c) 1994, The Regents of the University of California * diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index a2729cf6..f8425450 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -1,11 +1,11 @@ /*------------------------------------------------------------------------- * * pg_stat_monitor.c - * Track statement execution times across a whole database cluster. + * Track statement execution times across a whole database cluster. * - * Portions Copyright © 2018-2020, Percona LLC and/or its affiliates + * Portions Copyright © 2018-2024, Percona LLC and/or its affiliates * - * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * Portions Copyright (c) 1994, The Regents of the University of California * diff --git a/pg_stat_monitor.h b/pg_stat_monitor.h index 9cd590d1..a6ccc450 100644 --- a/pg_stat_monitor.h +++ b/pg_stat_monitor.h @@ -1,11 +1,11 @@ /*------------------------------------------------------------------------- * * pg_stat_monitor.h - * Track statement execution times across a whole database cluster. + * Track statement execution times across a whole database cluster. * - * Portions Copyright © 2018-2020, Percona LLC and/or its affiliates + * Portions Copyright © 2018-2024, Percona LLC and/or its affiliates * - * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * Portions Copyright (c) 1994, The Regents of the University of California *