Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code style and error check. #3

Merged
merged 4 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
# skipping auto generated folders
skip = ./.tox,./.mypy_cache,./target,*/LICENSE,./venv
thpierce marked this conversation as resolved.
Show resolved Hide resolved
ignore-words-list = ot
26 changes: 26 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[flake8]
ignore =
# line too long, defer to black
E501

# allow line breaks before binary ops
W503

# allow line breaks after binary ops
W504

# allow whitespace before ':' (https://github.com/psf/black#slices)
E203

exclude =
.bzr
.git
.hg
.svn
.tox
CVS
.venv*/
venv*/
target
__pycache__
scripts/*
thpierce marked this conversation as resolved.
Show resolved Hide resolved
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: AWS Distro Tests
thpierce marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
pull_request:
env:
CORE_REPO_SHA: da48e0b131ff34ff382b7d1206f71b2e31929cab
CONTRIB_REPO_SHA: 7c12ad9844ac179e3f6a493491707a9bafd06f6b
thpierce marked this conversation as resolved.
Show resolved Hide resolved

jobs:
misc:
strategy:
fail-fast: false
matrix:
tox-environment: ["spellcheck", "lint"]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-20.04
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install tox
run: pip install tox==3.27.1
- name: Install libsnappy-dev
if: ${{ matrix.tox-environment == 'lint' }}
run: sudo apt-get install -y libsnappy-dev
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v1
with:
path: |
.tox
~/.cache/pip
key: v7-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini',
'dev-requirements.txt') }}
- name: run tox
run: tox -e ${{ matrix.tox-environment }}
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
*.py[cod]
*.sw[op]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
dist-info
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
pyvenv.cfg
lib
lib64
__pycache__
venv*/
.venv*/

# Installer logs
pip-log.txt

# Unit test / coverage reports
coverage.xml
.coverage
.nox
.tox
.cache
htmlcov

# Translations
*.mo

# Mac
.DS_Store

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# JetBrains
.idea

# VSCode
.vscode

# Sphinx
_build/

# mypy
.mypy_cache/
target
19 changes: 19 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[settings]
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=79
profile=black

; 3 stands for Vertical Hanging Indent, e.g.
; from third_party import (
; lib1,
; lib2,
; lib3,
; )
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output=3
skip=target
skip_glob=**/gen/*,.venv*/*,venv*/*,.tox/*
known_first_party=opentelemetry
thpierce marked this conversation as resolved.
Show resolved Hide resolved
known_third_party=psutil,pytest,redis,redis_opentracing
thpierce marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading