Skip to content

Commit

Permalink
Merge pull request #32 from digitronik/pre_commit
Browse files Browse the repository at this point in the history
Pre commit
  • Loading branch information
digitronik committed Jan 1, 2020
2 parents e2057c8 + 78c8eba commit 1958bbe
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 17 deletions.
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
name: Trim Trailing Whitespace
language_version: python3
- id: end-of-file-fixer
name: File Ending
language_version: python3
- id: debug-statements
name: Debug Statments
language_version: python3
- id: flake8
name: Flake8
language_version: python3
verbose: true
- id: check-yaml
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.8.0
hooks:
- id: reorder-python-imports
name: Reorder Python Imports
language_version: python3
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
name: Formate with Black
args: [--safe, --quiet, --line-length, "100"]
language_version: python3
require_serial: true
- repo: https://github.com/asottile/pyupgrade
rev: v1.25.2
hooks:
- id: pyupgrade
name: Python Package Checks
language_version: python3
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ Simple command line application to spin [selenium docker container](https://hub.
For setting `docker` environment follow below steps:

- [Fedora](https://developer.fedoraproject.org/tools/docker/docker-installation.html)

* Set Repository:
```
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
```

* Install below packages:

```
sudo dnf -y install docker-ce
sudo systemctl start docker
sudo systemctl enable docker
```

* Run docker with non-root User:
```
sudo groupadd docker
sudo usermod -aG docker <non-root-user>
```

- [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/) and [others](https://docs.docker.com/install/)

2. **TigerVNC Viewer**:
Expand Down Expand Up @@ -109,11 +109,11 @@ The start will set command executor in `env.local.yaml` and provide `vnc` access
```shell
❯❯❯ miqsel start
Selenium Server started

TigerVNC Viewer 64-bit v1.9.0

❯❯❯ miqsel stop

Sun Apr 28 12:29:02 2019
CConn: End of stream
Selenium Server stopped
Expand All @@ -123,7 +123,7 @@ The start will set command executor in `env.local.yaml` and provide `vnc` access
Check current appliance or set new.
```shell
❯❯❯ miqsel appliance

❯❯❯ miqsel appliance -s 192.168.1.1
Appliance set to 192.168.1.1
❯❯❯ miqsel appliance
Expand All @@ -142,7 +142,7 @@ Check current browser or set other.
```

- **Viewer**:
Take `vnc` access of selenium server. At the start of selenium server, vnc viewer will be `invoked` automatically.
Take `vnc` access of selenium server. At the start of selenium server, vnc viewer will be `invoked` automatically.
If the `status` is `running` and the `viewer` is `close` then viewer command will help to re-open vnc session.

```shell
Expand Down
10 changes: 8 additions & 2 deletions miqsel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import click

from miqsel.config import config
from miqsel.env import appliance, browser
from miqsel.server import executor, start, status, stop, viewer, vnc
from miqsel.env import appliance
from miqsel.env import browser
from miqsel.server import executor
from miqsel.server import start
from miqsel.server import status
from miqsel.server import stop
from miqsel.server import viewer
from miqsel.server import vnc


@click.version_option()
Expand Down
3 changes: 2 additions & 1 deletion miqsel/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os

import click
from ruamel.yaml import safe_load, safe_dump
from ruamel.yaml import safe_dump
from ruamel.yaml import safe_load


class Configuration(object):
Expand Down
3 changes: 2 additions & 1 deletion miqsel/env.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os

import click
from ruamel.yaml import safe_load, safe_dump
from ruamel.yaml import safe_dump
from ruamel.yaml import safe_load

from miqsel.config import Configuration

Expand Down
3 changes: 2 additions & 1 deletion miqsel/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import time
from subprocess import PIPE, Popen
from subprocess import PIPE
from subprocess import Popen

import click
import docker
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys

from setuptools import find_packages, setup
from setuptools import find_packages
from setuptools import setup

assert sys.version_info >= (3, 6, 0), "miqsel requires Python 3.6+"

Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import shutil
from subprocess import PIPE, Popen
from subprocess import PIPE
from subprocess import Popen

import pytest

Expand Down

0 comments on commit 1958bbe

Please sign in to comment.