From 6e6f0731bb0d8962403cfd71fe6f76a99d98fa46 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 12 Oct 2023 15:28:18 -0600 Subject: [PATCH] Add and apply a pre-commit configuration Signed-off-by: Zack Cerza --- .env.dev | 4 ++-- .github/workflows/black.yaml | 2 +- .github/workflows/integration.yaml | 2 +- .pre-commit-config.yaml | 11 +++++++++++ .teuthology.yaml | 2 +- docs/conf.py | 5 +---- gh-actions/start.sh | 2 +- gunicorn_config.py | 5 ++--- 8 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.env.dev b/.env.dev index 8aa1f0f..234fb90 100644 --- a/.env.dev +++ b/.env.dev @@ -10,6 +10,6 @@ GH_TOKEN_URL='https://github.com/login/oauth/access_token' GH_FETCH_MEMBERSHIP_URL='https://api.github.com/user/memberships/orgs/ceph' #Session Related Stuff -## SESSION_SECRET_KEY is used to encrypt session data +## SESSION_SECRET_KEY is used to encrypt session data ## and it's prod value should be kept secret. -SESSION_SECRET_KEY=my-secret-key \ No newline at end of file +SESSION_SECRET_KEY=my-secret-key diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml index a061a8e..de97f25 100644 --- a/.github/workflows/black.yaml +++ b/.github/workflows/black.yaml @@ -10,4 +10,4 @@ jobs: - uses: psf/black@stable with: options: "--check --verbose" - src: "./src" \ No newline at end of file + src: "./src" diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 1f8458f..64e7b5d 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -8,4 +8,4 @@ jobs: - uses: actions/checkout@v2 - name: Start teuthology & teuthology-api run: ./start.sh - working-directory: ./gh-actions \ No newline at end of file + working-directory: ./gh-actions diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..48ee030 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black diff --git a/.teuthology.yaml b/.teuthology.yaml index 35c887a..daf22e3 100644 --- a/.teuthology.yaml +++ b/.teuthology.yaml @@ -4,4 +4,4 @@ lock_server: http://paddles:8080 results_server: http://paddles:8080 results_ui_server: http://pulpito:8081/ reserve_machines: 0 -lab_domain: '' \ No newline at end of file +lab_domain: '' diff --git a/docs/conf.py b/docs/conf.py index 01bc4b4..fc49c3e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -176,10 +176,7 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_options = { - "sidebar_width": "300px", - "page_width": "1200px" -} +html_theme_options = {"sidebar_width": "300px", "page_width": "1200px"} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] diff --git a/gh-actions/start.sh b/gh-actions/start.sh index b7552e2..7bd37e1 100755 --- a/gh-actions/start.sh +++ b/gh-actions/start.sh @@ -22,4 +22,4 @@ if [ ! -d "$folder" ] ; then " >> teuthology/docs/docker-compose/docker-compose.yml fi cd teuthology/docs/docker-compose -./start.sh \ No newline at end of file +./start.sh diff --git a/gunicorn_config.py b/gunicorn_config.py index a23e7a9..411b855 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -7,9 +7,8 @@ bind = f'{host}:{port}' workers = cpu_count() -worker_class = 'uvicorn.workers.UvicornWorker' +worker_class = "uvicorn.workers.UvicornWorker" # loglevel = 'debug' accesslog = os.path.expanduser("~/teuthology-api.access.log") -# errorlog = os.path.expanduser("~/teuthology-api.error.log") - +# errorlog = os.path.expanduser("~/teuthology-api.error.log")