Skip to content

Commit

Permalink
Add linting (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvhan028 authored Nov 6, 2024
1 parent bd71e3d commit bde4bc1
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pre-commit hook
run: |
python -m pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Format c/cuda codes with clang-format
uses: DoozyX/[email protected]
with:
source: src
extensions: h,c,cpp,hpp,cu,cuh,cc
clangFormatVersion: 11
style: file
- name: Check markdown link
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.github/md-link-config.json'
file-path: './README.md, ./LICENSE, ./README_zh-CN.md'
44 changes: 44 additions & 0 deletions .github/md-link-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"ignorePatterns": [
{
"pattern": "^https://www.reddit.com/"
},
{
"pattern": "^https://developer.nvidia.com/"
},
{
"pattern": "^https://docs.openvino.ai/"
},
{
"pattern": "^https://developer.android.com/"
},
{
"pattern": "^https://developer.qualcomm.com/"
},
{
"pattern": "^http://localhost"
},
{
"pattern": "^https://twitter.com"
},
{
"pattern": "^https://platform.openai.com"
},
{
"pattern": "^http://0.0.0.0"
}
],
"httpHeaders": [
{
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
"timeout": "20s",
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [200, 206, 429]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024-2025 Shanghai AI Laboratory

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit bde4bc1

Please sign in to comment.