This is an automated email from the ASF dual-hosted git repository.

nic443 pushed a commit to branch feat/ai-fixture-system
in repository https://gitbox.apache.org/repos/asf/apisix.git

commit db6e7004f4b42f021104a46963376545e6cc90e3
Author: Nic <[email protected]>
AuthorDate: Thu Apr 16 23:07:24 2026 +0800

    fix: resolve CI lint issues
    
    - Add license header to t/fixtures/README.md
    - Add *.sse to .licenserc.yaml paths-ignore (data files, not source code)
    - Add *.sse editorconfig exception (SSE data may contain intentional 
trailing whitespace)
    - Add final newlines to JSON fixture files
    - Fix trailing whitespace in ai-proxy2.t
---
 .editorconfig                                        |  4 ++++
 .licenserc.yaml                                      |  1 +
 t/fixtures/README.md                                 | 19 +++++++++++++++++++
 t/fixtures/aliyun/chat-with-harmful.json             |  2 +-
 t/fixtures/aliyun/moderation-risk.json               |  2 +-
 t/fixtures/aliyun/moderation-safe.json               |  2 +-
 t/fixtures/anthropic/messages-with-cache.json        |  2 +-
 t/fixtures/openai/chat-model-echo.json               |  2 +-
 t/fixtures/openai/embeddings-list.json               |  2 +-
 t/fixtures/prometheus/chat-basic.json                |  2 +-
 t/fixtures/protocol-conversion/system-prompt-ok.json |  2 +-
 t/fixtures/vertex-ai/predictions-embeddings.json     |  2 +-
 t/plugin/ai-proxy2.t                                 |  4 ++--
 13 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 62357920a..38c0dec25 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -51,3 +51,7 @@ indent_style = unset
 insert_final_newline = unset
 trim_trailing_whitespace = unset
 end_of_line = unset
+
+[*.sse]
+trim_trailing_whitespace = unset
+insert_final_newline = unset
diff --git a/.licenserc.yaml b/.licenserc.yaml
index 86edebf9f..7164223ce 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -28,6 +28,7 @@ header:
     - 'LICENSE'
     - 'NOTICE'
     - '**/*.json'
+    - '**/*.sse'
     - '**/*.key'
     - '**/*.crt'
     - '**/*.pem'
diff --git a/t/fixtures/README.md b/t/fixtures/README.md
index 7bb4ea6fc..fb56680d1 100644
--- a/t/fixtures/README.md
+++ b/t/fixtures/README.md
@@ -1,3 +1,22 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
 # AI Gateway Test Fixtures
 
 This directory contains mock API responses used by AI proxy test cases.
diff --git a/t/fixtures/aliyun/chat-with-harmful.json 
b/t/fixtures/aliyun/chat-with-harmful.json
index 472a09884..13540cd7c 100644
--- a/t/fixtures/aliyun/chat-with-harmful.json
+++ b/t/fixtures/aliyun/chat-with-harmful.json
@@ -11,4 +11,4 @@
   "model": "gpt-3.5-turbo",
   "object": "chat.completion",
   "usage": { "completion_tokens": 5, "prompt_tokens": 8, "total_tokens": 10 }
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/aliyun/moderation-risk.json 
b/t/fixtures/aliyun/moderation-risk.json
index 816d5b5fb..d2f71cff9 100644
--- a/t/fixtures/aliyun/moderation-risk.json
+++ b/t/fixtures/aliyun/moderation-risk.json
@@ -18,4 +18,4 @@
     ]
   },
   "Code": 200
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/aliyun/moderation-safe.json 
b/t/fixtures/aliyun/moderation-safe.json
index 33f586eb4..98caf8b71 100644
--- a/t/fixtures/aliyun/moderation-safe.json
+++ b/t/fixtures/aliyun/moderation-safe.json
@@ -11,4 +11,4 @@
     ]
   },
   "Code": 200
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/anthropic/messages-with-cache.json 
b/t/fixtures/anthropic/messages-with-cache.json
index 169c68cd4..ff16e9c5a 100644
--- a/t/fixtures/anthropic/messages-with-cache.json
+++ b/t/fixtures/anthropic/messages-with-cache.json
@@ -11,4 +11,4 @@
     "cache_creation_input_tokens": 100,
     "cache_read_input_tokens": 200
   }
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/openai/chat-model-echo.json 
b/t/fixtures/openai/chat-model-echo.json
index f5d717e4b..2b783ca9c 100644
--- a/t/fixtures/openai/chat-model-echo.json
+++ b/t/fixtures/openai/chat-model-echo.json
@@ -12,4 +12,4 @@
   "object": "chat.completion",
   "system_fingerprint": "fp_abc28019ad",
   "usage": { "completion_tokens": 5, "prompt_tokens": 8, "total_tokens": 10 }
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/openai/embeddings-list.json 
b/t/fixtures/openai/embeddings-list.json
index 27fc82c8f..9be2560c9 100644
--- a/t/fixtures/openai/embeddings-list.json
+++ b/t/fixtures/openai/embeddings-list.json
@@ -16,4 +16,4 @@
     "prompt_tokens": 8,
     "total_tokens": 8
   }
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/prometheus/chat-basic.json 
b/t/fixtures/prometheus/chat-basic.json
index 9aca17bf7..a0b462e92 100644
--- a/t/fixtures/prometheus/chat-basic.json
+++ b/t/fixtures/prometheus/chat-basic.json
@@ -12,4 +12,4 @@
     "prompt_tokens": 8,
     "total_tokens": 13
   }
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/protocol-conversion/system-prompt-ok.json 
b/t/fixtures/protocol-conversion/system-prompt-ok.json
index 77b7c8d9e..5ef8beb95 100644
--- a/t/fixtures/protocol-conversion/system-prompt-ok.json
+++ b/t/fixtures/protocol-conversion/system-prompt-ok.json
@@ -8,4 +8,4 @@
         "finish_reason": "stop"
     }],
     "usage": {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}
-}
\ No newline at end of file
+}
diff --git a/t/fixtures/vertex-ai/predictions-embeddings.json 
b/t/fixtures/vertex-ai/predictions-embeddings.json
index 6448d1024..7ff74ad33 100644
--- a/t/fixtures/vertex-ai/predictions-embeddings.json
+++ b/t/fixtures/vertex-ai/predictions-embeddings.json
@@ -9,4 +9,4 @@
       }
     }
   ]
-}
\ No newline at end of file
+}
diff --git a/t/plugin/ai-proxy2.t b/t/plugin/ai-proxy2.t
index 889589a77..9cb5b78d8 100644
--- a/t/plugin/ai-proxy2.t
+++ b/t/plugin/ai-proxy2.t
@@ -147,7 +147,7 @@ POST /anything
 X-AI-Fixture: openai/chat-basic.json
 --- error_code: 200
 --- response_body eval
-qr/"content":"1 \+ 1 = 2\."/ 
+qr/"content":"1 \+ 1 = 2\."/
 
 
 
@@ -247,4 +247,4 @@ POST /anything
 X-AI-Fixture: openai/chat-basic.json
 --- error_code: 200
 --- response_body eval
-qr/"content":"1 \+ 1 = 2\."/ 
+qr/"content":"1 \+ 1 = 2\."/

Reply via email to