Skip to content

Commit

Permalink
Upgrade and run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
skorokithakis committed Jan 27, 2021
1 parent a247d0f commit 0c8c136
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 39 deletions.
27 changes: 14 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 1,15 @@
repos:
- repo: https://github.com/ambv/black
rev: 18.9b0
hooks:
- id: black
- repo: git://github.com/doublify/pre-commit-isort
rev: v4.3.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: flake8
additional_dependencies: [flake8~=3.6.0]
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.5
hooks:
- id: reorder-python-imports
- repo: https://gitlab.com/pycqa/flake8
rev: '3.8.4'
hooks:
- id: flake8
args: ["--config=setup.cfg"]
language_version: python3
5 changes: 3 additions & 2 deletions mp/conserial.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 21,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##

import logging
import time

from mp.conbase import ConBase, ConError
from serial import Serial

from mp.conbase import ConBase
from mp.conbase import ConError


class ConSerial(ConBase):
def __init__(self, port, baudrate=115200, reset=False):
Expand Down
5 changes: 2 additions & 3 deletions mp/contelnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 21,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##


import sys
import telnetlib
import time
from collections import deque

from mp.conbase import ConBase, ConError
from mp.conbase import ConBase
from mp.conbase import ConError


class ConTelnet(ConBase):
Expand Down
6 changes: 3 additions & 3 deletions mp/conwebsock.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 21,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##


import logging
import threading
import time
from collections import deque

import websocket
from mp.conbase import ConBase, ConError

from mp.conbase import ConBase
from mp.conbase import ConError


class ConWebsock(ConBase, threading.Thread):
Expand Down
5 changes: 2 additions & 3 deletions mp/mpfexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##


import ast
import binascii
import getpass
Expand All @@ -37,7 35,8 @@
from mp.conserial import ConSerial
from mp.contelnet import ConTelnet
from mp.conwebsock import ConWebsock
from mp.pyboard import Pyboard, PyboardError
from mp.pyboard import Pyboard
from mp.pyboard import PyboardError
from mp.retry import retry


Expand Down
11 changes: 6 additions & 5 deletions mp/mpfshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##


import argparse
import cmd
import glob
Expand All @@ -35,9 33,12 @@

import colorama
import serial

from mp import version
from mp.conbase import ConError
from mp.mpfexp import MpFileExplorer, MpFileExplorerCaching, RemoteIOError
from mp.mpfexp import MpFileExplorer
from mp.mpfexp import MpFileExplorerCaching
from mp.mpfexp import RemoteIOError
from mp.pyboard import PyboardError
from mp.tokenizer import Tokenizer

Expand Down Expand Up @@ -258,8 259,8 @@ def do_ls(self, args):

def do_pwd(self, args):
"""pwd
Print current remote directory.
"""
Print current remote directory.
"""
if self.__is_open():
print(self.fe.pwd())

Expand Down
2 changes: 0 additions & 2 deletions mp/pyboard.py
Original file line number Diff line number Diff line change
@@ -1,9 1,7 @@
#!/usr/bin/env python

"""
Pyboard REPL interface
"""

import sys
import time

Expand Down
2 changes: 0 additions & 2 deletions mp/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##


import serial

if serial.VERSION.startswith("2."):
Expand Down
1 change: 0 additions & 1 deletion mp/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##

import re


Expand Down
3 changes: 2 additions & 1 deletion tests/modules/test_tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
from mp.tokenizer import Token, Tokenizer
from mp.tokenizer import Token
from mp.tokenizer import Tokenizer


class TestTokenizer:
Expand Down
5 changes: 3 additions & 2 deletions tests/ontarget/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 21,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##

# enable logging of modules under test
import logging

import pytest
from mp.mpfexp import MpFileExplorer, MpFileExplorerCaching

from mp.mpfexp import MpFileExplorer
from mp.mpfexp import MpFileExplorerCaching

_mpfexp_inst = None

Expand Down
3 changes: 1 addition & 2 deletions tests/ontarget/test_mpfexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 21,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##


import os

import pytest

from mp.mpfshell import RemoteIOError


Expand Down

0 comments on commit 0c8c136

Please sign in to comment.