Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 902df12

Browse files
authoredJun 27, 2023
Add GitHub action to format and lint code (#265)
* Set up pre-commit * Apply pre-commit * Make max-line-length 88 * Remove unnecessary line * Run pre-install with updated config * End of file newline * Fix comment * Remove unused variable * Add and apply isort * Newline at eof * Remove duplicate copyrights, add hooks link * Pin workflow Ubuntu version * Remove unnecessary imports * Remove unused import, update copyrights
1 parent 7865b03 commit 902df12

Some content is hidden

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

63 files changed

+1358
-1039
lines changed
 

‎.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ jobs:
6363
# If you wish to specify custom queries, you can do so here or in a config file.
6464
# By default, queries listed here will override any specified in a config file.
6565
# Prefix the list here with "+" to use these queries and those in the config file.
66-
66+
6767
# Details on CodeQL's query packs refer to:
6868
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
6969
queries: +security-and-quality
7070

71-
71+
7272
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
7373
# If this step fails, then you should remove it and run the build manually (see below)
7474
- name: Autobuild
@@ -77,7 +77,7 @@ jobs:
7777
# Command-line programs to run using the OS shell.
7878
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
7979

80-
# If the Autobuild fails above, remove it and uncomment the following three lines.
80+
# If the Autobuild fails above, remove it and uncomment the following three lines.
8181
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
8282

8383
# - run: |

‎.github/workflows/pre-commit.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions
5+
# are met:
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of NVIDIA CORPORATION nor the names of its
12+
# contributors may be used to endorse or promote products derived
13+
# from this software without specific prior written permission.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
16+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
27+
name: pre-commit
28+
29+
on:
30+
pull_request:
31+
push:
32+
branches: [main]
33+
34+
jobs:
35+
pre-commit:
36+
runs-on: ubuntu-22.04
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-python@v3
40+
- uses: pre-commit/action@v3.0.0

0 commit comments

Comments
 (0)
Please sign in to comment.