Skip to content

Commit 57e1bcc

Browse files
lrvideckisweb-flow
andauthored
Add grep (#142)
* add greps checking that kactl macros are used * fix * fix * rename script * fix * [auto-verifier] verify commit b6b610f * another fix * [auto-verifier] verify commit 3cc8c13 --------- Co-authored-by: GitHub <noreply@github.com>
1 parent 776a2bd commit 57e1bcc

File tree

7 files changed

+27
-17
lines changed

7 files changed

+27
-17
lines changed

.github/workflows/programming_team_code_ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
run: oj-verify all --tle 60 --timeout 21600
3131

32-
greps_clangformat_cppcheck:
32+
grep_clangformat_cppcheck:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- uses: actions/checkout@v2
@@ -41,7 +41,7 @@ jobs:
4141
- name: Install dependencies
4242
run: sudo apt update && sudo apt install -y clang-format-19 cppcheck
4343
- name: checks format then lints
44-
run: make --directory=tests/ greps_clangformat_cppcheck
44+
run: make --directory=tests/ grep_clangformat_cppcheck
4545

4646
clangtidy:
4747
runs-on: ubuntu-latest
@@ -101,7 +101,7 @@ jobs:
101101

102102
publish_ptc:
103103
runs-on: ubuntu-latest
104-
needs: [library_checker_aizu, greps_clangformat_cppcheck, clangtidy, compile_gcc, compile_clang, files_without_tests, build_ptc]
104+
needs: [library_checker_aizu, grep_clangformat_cppcheck, clangtidy, compile_gcc, compile_clang, files_without_tests, build_ptc]
105105
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
106106
steps:
107107
- uses: actions/checkout@v2
@@ -119,7 +119,7 @@ jobs:
119119

120120
update_main:
121121
runs-on: ubuntu-latest
122-
needs: [library_checker_aizu, greps_clangformat_cppcheck, clangtidy, compile_gcc, compile_clang, files_without_tests]
122+
needs: [library_checker_aizu, grep_clangformat_cppcheck, clangtidy, compile_gcc, compile_clang, files_without_tests]
123123
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
124124
steps:
125125
- uses: actions/checkout@v2

.verify-helper/timestamps.remote.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"tests/library_checker_aizu_tests/convolution/gcd_convolution.test.cpp": "2024-11-17 14:04:03 -0600",
3-
"tests/library_checker_aizu_tests/convolution/lcm_convolution.test.cpp": "2024-11-17 14:04:03 -0600",
2+
"tests/library_checker_aizu_tests/convolution/gcd_convolution.test.cpp": "2025-06-25 15:00:16 -0600",
3+
"tests/library_checker_aizu_tests/convolution/lcm_convolution.test.cpp": "2025-06-25 15:00:16 -0600",
44
"tests/library_checker_aizu_tests/convolution/min_plus_convolution.test.cpp": "2024-11-17 14:04:03 -0600",
55
"tests/library_checker_aizu_tests/data_structures/binary_search_example.test.cpp": "2024-11-18 10:51:39 -0600",
66
"tests/library_checker_aizu_tests/data_structures/binary_trie.test.cpp": "2024-11-17 14:04:03 -0600",
@@ -50,10 +50,10 @@
5050
"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
5151
"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600",
5252
"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2024-12-05 10:41:42 -0600",
53-
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2025-06-24 14:51:53 -0600",
54-
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-06-24 14:51:53 -0600",
55-
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-06-24 14:51:53 -0600",
56-
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-06-24 14:51:53 -0600",
53+
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2025-06-25 15:02:17 -0600",
54+
"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-06-25 15:02:17 -0600",
55+
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-06-25 15:02:17 -0600",
56+
"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-06-25 15:02:17 -0600",
5757
"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-02-10 23:30:47 -0700",
5858
"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2024-12-14 19:50:29 -0600",
5959
"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600",

library/convolution/gcd_convolution.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! @code
33
//! auto gcd_conv = gcd_convolution(a, b);
44
//! @endcode
5-
//! ssize(a)==ssize(b)
5+
//! sz(a)==sz(b)
66
//! gcd_conv[k] = sum of (a[i]*b[j])
77
//! for all pairs (i,j) where gcd(i,j)==k
88
//! @time O(n log n)

library/convolution/lcm_convolution.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! @code
33
//! auto lcm_conv = lcm_convolution(a, b);
44
//! @endcode
5-
//! ssize(a)==ssize(b)
5+
//! sz(a)==sz(b)
66
//! lcm_conv[k] = sum of (a[i]*b[j])
77
//! for all pairs (i,j) where lcm(i,j)==k
88
//! @time O(n log n)

library/graphs/bridges_cuts/bcc_callback.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! https://cp-algorithms.com/graph/cutpoints.html
33
//! @code
44
//! {
5-
//! vector<vector<int>> adj(n);
5+
//! vector<vi> adj(n);
66
//! UF uf(n);
77
//! vector<bool> seen(n);
88
//! bcc_callback(adj, [&](const vi& nodes) {

tests/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ help:
77
@echo " |"
88
@echo "make compile_commented_snippets | compile code in @code...@endcode comments"
99
@echo " |"
10-
@echo "make greps_clangformat_cppcheck | greps to catch various bad things, clang-format, cppcheck"
10+
@echo "make grep_clangformat_cppcheck | various greps to catch certain things, clang-format, cppcheck"
1111
@echo " |"
1212
@echo "make do_format | format with clang-format"
1313
@echo " |"
@@ -31,8 +31,8 @@ compile_gcc:
3131
compile_clang:
3232
./scripts/compile_clang.sh
3333

34-
greps_clangformat_cppcheck:
35-
./scripts/greps_clangformat_cppcheck.sh
34+
grep_clangformat_cppcheck:
35+
./scripts/grep_clangformat_cppcheck.sh
3636

3737
do_format:
3838
./scripts/do_format.sh

tests/scripts/greps_clangformat_cppcheck.sh renamed to tests/scripts/grep_clangformat_cppcheck.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,18 @@ grep "true" --recursive ../library/ && exit 1
1919
echo "check 0 instead of false"
2020
grep "false" --recursive ../library/ && exit 1
2121

22-
echo "check int64_t instead of long long"
22+
echo "check ll instead of long long or int64_t"
2323
grep "long long" --recursive ../library/ && exit 1
24+
grep "int64_t" --recursive ../library/**/*.hpp | grep "uint64_t" --invert-match && exit 1
25+
26+
echo "check pii instead of pair<int, int>"
27+
grep "pair<int, int>" --recursive ../library/**/*.hpp && exit 1
28+
29+
echo "check sz instead of ssize"
30+
grep "ssize" --recursive ../library/ && exit 1
31+
32+
echo "check vi instead of vector<int>"
33+
grep "vector<int>" --recursive ../library/**/*.hpp && exit 1
2434

2535
echo "check begin(arr) instead of arr.begin(), similarly for end, rbegin, rend, empty, size:"
2636
# TODO: remove this define filter if/when we move to -std=c++20

0 commit comments

Comments
 (0)