Skip to content

Commit 75dbf51

Browse files
committed
Add CI job to check copyright headers in Rust files
Signed-off-by: Eeshu-Yadav <eeshuyadav123@gmail.com>
1 parent 7405f98 commit 75dbf51

191 files changed

Lines changed: 29 additions & 380 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
name: CI — fmt, clippy, build, test
22

33
on:
4-
push:
5-
branches: [ main, master ]
4+
push: - name: Check copyright headers
5+
run: |
6+
EXPECTED_HEADER=$(tail -n +3 tools/copyright_header.txt)
7+
find . -name "*.rs" -type f | while read -r file; do
8+
if [[ "$file" == *"/target/"* ]] || [[ "$file" == *"/envoy-data-plane-api/"* ]]; then
9+
continue
10+
fi
11+
header=$(head -n 16 "$file")
12+
if [[ "$header" != "$EXPECTED_HEADER" ]]; then
13+
echo "Incorrect copyright header in: $file"
14+
exit 1
15+
fi
16+
done
17+
echo "All Rust files have correct copyright headers." [ main, master ]
618
pull_request:
719
branches: [ main, master ]
820

@@ -46,6 +58,21 @@ jobs:
4658
- name: Run clippy (fail on warnings)
4759
run: cargo clippy --all-targets --all-features
4860

61+
- name: Check copyright headers
62+
run: |
63+
EXPECTED_HEADER=$(cat tools/copyright_header.txt)
64+
find . -name "*.rs" -type f | while read -r file; do
65+
if [[ "$file" == *"/target/"* ]] || [[ "$file" == *"/envoy-data-plane-api/"* ]]; then
66+
continue
67+
fi
68+
header=$(head -n 16 "$file")
69+
if [[ "$header" != "$EXPECTED_HEADER" ]]; then
70+
echo "Incorrect copyright header in: $file"
71+
exit 1
72+
fi
73+
done
74+
echo "All Rust files have correct copyright headers."
75+
4976
# Build and test that share artifacts
5077
build-and-test:
5178
name: build + test

orion-configuration/examples/convert.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
#![allow(clippy::print_stdout)]
1917

orion-configuration/src/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
pub mod bootstrap;
1917
pub use bootstrap::Bootstrap;

orion-configuration/src/config/bootstrap.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
use std::time::Duration;
1917

orion-configuration/src/config/cluster.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
pub mod health_check;
1917
pub use health_check::HealthCheck;

orion-configuration/src/config/cluster/cluster_specifier.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
use compact_str::CompactString;
1917
use serde::{Deserialize, Serialize};

orion-configuration/src/config/cluster/health_check.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
use crate::config::common::is_default;
1917
use compact_str::CompactString;

orion-configuration/src/config/cluster/http_protocol_options.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
use crate::config::common::is_default;
1917
use serde::{Deserialize, Serialize};

orion-configuration/src/config/common.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
use compact_str::CompactString;
1917
use regex::Regex;

orion-configuration/src/config/core.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2025 The kmesh Authors
22
//
3-
//
43
// Licensed under the Apache License, Version 2.0 (the "License");
54
// you may not use this file except in compliance with the License.
65
// You may obtain a copy of the License at
@@ -13,7 +12,6 @@
1312
// See the License for the specific language governing permissions and
1413
// limitations under the License.
1514
//
16-
//
1715

1816
use crate::config::common::*;
1917
use base64::engine::general_purpose::STANDARD;

0 commit comments

Comments
 (0)