Skip to content

Commit

Permalink
🧹 Run pre-commit on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand committed May 17, 2024
1 parent 3df4fab commit f49d1a4
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 36 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = [
{
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
env: {
es6: true,
node: true,
},
rules: {
'no-var': 'error',
semi: ['error', 'never'],
indent: ['error', 2],
'no-multi-spaces': 'error',
'space-in-parens': 'error',
'no-multiple-empty-lines': 'error',
'prefer-const': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
},
},
]
6 changes: 3 additions & 3 deletions integrationtests/prepare_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def write_initial_settings():
"""Write initial settings to a file"""
"""Write initial settings to a file."""
initial_settings = {
"executable": sys.executable,
"version_info": str(sys.version_info),
Expand All @@ -15,13 +15,13 @@ def write_initial_settings():


def read_initial_settings():
"""Read initial settings to a file"""
"""Read initial settings to a file."""
with open("initial_settings.json") as f:
return json.load(f)


def run_cmd(cmd):
"""Run shell command in a python2/3 compatible way"""
"""Run shell command in a python2/3 compatible way."""
process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
)
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@


def test_conda_installed():
"""Conda is callable from the shell"""
"""Conda is callable from the shell."""
returncode, stdout, stderr = run_cmd("conda --version")
assert returncode == 0
assert stdout.startswith(b"conda")
assert stderr == b""


def test_conda_channels():
"""Conda channels are added in order"""
"""Conda channels are added in order."""
returncode, stdout, stderr = run_cmd(" conda config --show channels")
expected = os.environ["CONDA_CHANNELS"].split(",")
channel_list = stdout.decode().partition(":")[2].split(" - ")
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/test_installed_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@


def test_pandoc_installed():
"""Pandoc is callable from the shell"""
"""Pandoc is callable from the shell."""
returncode, stdout, stderr = run_cmd("pandoc -v")
assert returncode == 0
assert stdout.startswith(b"pandoc")
assert stderr == b""


def test_garphviz_installed():
"""Graphviz is installed"""
"""Graphviz is installed."""
if sys.platform == "win32":
returncode, stdout, stderr = run_cmd("dot.bat -V")
else:
Expand Down
8 changes: 4 additions & 4 deletions integrationtests/test_python_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@

@pytest.mark.skipif("NOT_ACTIVATED" not in os.environ, reason="Conda python is used")
def test_python_not_changed():
"""Same python as initially"""
"""Same python as initially."""
initial_settings = read_initial_settings()
assert initial_settings["executable"] == sys.executable
assert initial_settings["version_info"] == str(sys.version_info)


@pytest.mark.skipif("NOT_ACTIVATED" in os.environ, reason="Conda python is not used")
def test_python_from_conda():
"""Same python if from conda"""
"""Same python if from conda."""
initial_settings = read_initial_settings()
assert initial_settings["executable"] != sys.executable
assert "miniconda" in sys.executable.lower()


@pytest.mark.skipif("ENV_PYTHON" not in os.environ, reason="Not a conda custom python")
def test_custom_python_from_conda():
"""Same python if from conda"""
"""Same python if from conda."""
assert sys.version.startswith(os.environ["ENV_PYTHON"])


@pytest.mark.skipif("PYPY_TEST" not in os.environ, reason="Not a pypy test")
def test_pypy_from_conda():
"""Installed python version is PyPy"""
"""Installed python version is PyPy."""
assert sys.version.splitlines()[1].startswith("[PyPy")

0 comments on commit f49d1a4

Please sign in to comment.