Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
meta: Move directorutil into 'shared' directory
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymoose2 committed Apr 24, 2020
1 parent 98064b9 commit 89e6ba3
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manager/directorutil
2 changes: 1 addition & 1 deletion orchestrator/directorutil
3 changes: 3 additions & 0 deletions shared/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 100
exclude=*/media/*,*/migrations/*,secret*
9 changes: 9 additions & 0 deletions shared/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
line_length=100
multi_line_output=3
include_trailing_comma=true
skip_glob=secret*

known_directorutil=directorutil
default_section=THIRDPARTY
sections=FUTURE,STDLIB,THIRDPARTY,DIRECTORUTIL,LOCALFOLDER
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ssl
from typing import Any, Dict, Optional


def create_internal_client_ssl_context(
ssl_settings: Optional[Dict[str, Any]],
) -> Optional[ssl.SSLContext]:
Expand Down
2 changes: 2 additions & 0 deletions shared/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
ignore_missing_imports = True
9 changes: 9 additions & 0 deletions shared/pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[MAIN]
# disable fixme so it doesn't block builds
disable=missing-docstring,no-else-return,no-else-raise,no-else-break,bad-continuation,duplicate-code,too-many-branches,too-many-nested-blocks,too-many-locals,too-many-statements,too-many-public-methods,fixme,too-many-return-statements
max-line-length=100
ignore-patterns=secret*

good-names=i,j,j,ex,ch,fd,rc,T,_,js

const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$
19 changes: 19 additions & 0 deletions shared/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.black]
line-length = 100
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| media
| migrations
| secret.*
)/
'''
11 changes: 11 additions & 0 deletions shared/scripts/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
cd "$(dirname -- "$(dirname -- "$(readlink -f "$0")")")"

for cmd in flake8 isort mypy pylint; do
if [[ ! -x "$(which "$cmd")" ]]; then
echo "Could not find $cmd. Please make sure that flake8, isort, mypy, and pylint are all installed."
exit 1
fi
done

flake8 directorutil && isort --recursive --check directorutil && mypy directorutil && pylint directorutil
13 changes: 13 additions & 0 deletions shared/scripts/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd "$(dirname -- "$(dirname -- "$(readlink -f "$0")")")"

for cmd in black autopep8 isort; do
if [[ ! -x "$(which "$cmd")" ]]; then
echo "Could not find $cmd. Please make sure that black, autopep8, and isort are all installed."
exit 1
fi
done

# Order is important. There are a few things that black and autopep8 disagree on, and I side
# with autopep8 on those.
black directorutil && autopep8 --in-place --recursive directorutil && isort --recursive directorutil
2 changes: 1 addition & 1 deletion shell/directorutil

0 comments on commit 89e6ba3

Please sign in to comment.