Skip to content

Commit

Permalink
Merge 4b3c22e into 1ddede8
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Jul 11, 2019
2 parents 1ddede8 + 4b3c22e commit b3cc641
Show file tree
Hide file tree
Showing 43 changed files with 145 additions and 194 deletions.
1 change: 1 addition & 0 deletions .pylint.ini
Expand Up @@ -124,6 +124,7 @@ disable=
logging-format-interpolation,
duplicate-code,
unpacking-non-sequence,
ungrouped-imports,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Expand Up @@ -60,8 +60,7 @@ poetry.lock: pyproject.toml

.PHONY: format
format: install
# TODO: Format imports using isort
# poetry run isort $(PACKAGES) --recursive --apply
poetry run isort $(PACKAGES) --recursive --apply
# TODO: Format code using black after dropping Python 3.5 support
# poetry run black $(PACKAGES)
@ echo
Expand Down
5 changes: 2 additions & 3 deletions doorstop/cli/commands.py
Expand Up @@ -5,11 +5,10 @@
import os
import time

from doorstop import common
from doorstop import common, server
from doorstop.cli import utilities
from doorstop.core import editor, exporter, importer, publisher
from doorstop.core.builder import build
from doorstop.core import editor, importer, exporter, publisher
from doorstop import server

log = common.logger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions doorstop/cli/main.py
Expand Up @@ -3,13 +3,13 @@

"""Command-line interface for Doorstop."""

import argparse
import os
import sys
import argparse

from doorstop import common, settings
from doorstop.cli import utilities, commands
from doorstop.core import publisher, vcs, document
from doorstop.cli import commands, utilities
from doorstop.core import document, publisher, vcs

log = common.logger(__name__)

Expand Down
15 changes: 6 additions & 9 deletions doorstop/cli/tests/test_all.py
Expand Up @@ -2,22 +2,19 @@

"""Integration tests for the doorstop.cli package."""

import unittest
from unittest.mock import patch, Mock

import os
import tempfile
import shutil
import tempfile
import unittest
from unittest.mock import Mock, patch

from doorstop import common, settings
from doorstop.cli.main import main
from doorstop import common
from doorstop.cli.tests import (ENV, FILES, REASON, REQS, ROOT, TUTORIAL,
SettingsTestCase)
from doorstop.core.builder import _clear_tree
from doorstop import settings
from doorstop.core.document import Document

from doorstop.cli.tests import ENV, REASON, ROOT, FILES, REQS, TUTORIAL
from doorstop.cli.tests import SettingsTestCase

REQ_COUNT = 17
ALL_COUNT = 49

Expand Down
5 changes: 2 additions & 3 deletions doorstop/cli/tests/test_main.py
Expand Up @@ -2,11 +2,10 @@

"""Unit tests for the doorstop.cli.main module."""

from unittest.mock import patch, Mock
from unittest.mock import Mock, patch

from doorstop.cli import main
from doorstop import settings

from doorstop.cli import main
from doorstop.cli.tests import SettingsTestCase


Expand Down
9 changes: 4 additions & 5 deletions doorstop/cli/tests/test_tutorial.py
Expand Up @@ -3,15 +3,14 @@

"""Integration tests for the documentation tutorials."""

import unittest

import logging
import os
import shutil
import tempfile
import subprocess
import logging
import tempfile
import unittest

from doorstop.cli.tests import ROOT, FILES
from doorstop.cli.tests import FILES, ROOT

ENV = 'TEST_TUTORIAL' # environment variable to enable the tutorial example
REASON = "'{0}' variable not set".format(ENV)
Expand Down
6 changes: 2 additions & 4 deletions doorstop/cli/tests/test_utilities.py
Expand Up @@ -4,14 +4,12 @@

import sys
import unittest
from unittest.mock import patch, Mock
from argparse import ArgumentTypeError
from unittest.mock import Mock, patch
from warnings import catch_warnings

from doorstop import common, settings
from doorstop.cli import utilities
from doorstop import common
from doorstop import settings

from doorstop.cli.tests import SettingsTestCase


Expand Down
7 changes: 3 additions & 4 deletions doorstop/cli/utilities.py
Expand Up @@ -2,14 +2,13 @@

"""Shared functions for the `doorstop.cli` package."""

import os
import ast
from argparse import ArgumentTypeError
import logging
import os
import warnings
from argparse import ArgumentTypeError

from doorstop import common
from doorstop import settings
from doorstop import common, settings

log = common.logger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions doorstop/common.py
Expand Up @@ -2,11 +2,11 @@

"""Common exceptions, classes, and functions for Doorstop."""

import os
import shutil
import argparse
import logging
import glob
import logging
import os
import shutil

import yaml

Expand Down
7 changes: 3 additions & 4 deletions doorstop/core/base.py
Expand Up @@ -2,15 +2,14 @@

"""Base classes and decorators for the doorstop.core package."""

import os
import abc
import functools
import os

import yaml

from doorstop import common
from doorstop.common import DoorstopError, DoorstopWarning, DoorstopInfo
from doorstop import settings
from doorstop import common, settings
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning

log = common.logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/builder.py
Expand Up @@ -7,8 +7,8 @@
from doorstop import common
from doorstop.common import DoorstopError
from doorstop.core import vcs
from doorstop.core.tree import Tree
from doorstop.core.document import Document
from doorstop.core.tree import Tree

log = common.logger(__name__)
_tree = None # implicit tree for convenience functions
Expand Down
17 changes: 8 additions & 9 deletions doorstop/core/document.py
Expand Up @@ -3,18 +3,17 @@
"""Representation of a collection of items."""

import os
from itertools import chain
from collections import OrderedDict
import re
from collections import OrderedDict
from itertools import chain

from doorstop import common
from doorstop.common import DoorstopError, DoorstopWarning, DoorstopInfo
from doorstop.core.base import (add_document, edit_document, delete_document,
auto_load, auto_save,
BaseValidatable, BaseFileObject)
from doorstop.core.types import Prefix, UID, Level
from doorstop import common, settings
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
from doorstop.core.base import (BaseFileObject, BaseValidatable, add_document,
auto_load, auto_save, delete_document,
edit_document)
from doorstop.core.item import Item
from doorstop import settings
from doorstop.core.types import UID, Level, Prefix

log = common.logger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions doorstop/core/editor.py
Expand Up @@ -3,11 +3,11 @@
"""Functions to edit documents and items."""

import os
import sys
from distutils.spawn import find_executable
import subprocess
import time
import sys
import tempfile
import time
from distutils.spawn import find_executable

from doorstop import common
from doorstop.common import DoorstopError
Expand Down
7 changes: 3 additions & 4 deletions doorstop/core/exporter.py
Expand Up @@ -2,18 +2,17 @@

"""Functions to export documents and items."""

import os
import csv
import datetime
import os
from collections import defaultdict

import yaml
import openpyxl
import yaml

from doorstop import common
from doorstop import common, settings
from doorstop.common import DoorstopError
from doorstop.core.types import iter_documents, iter_items
from doorstop import settings

LIST_SEP = '\n' # string separating list values when joined in a string

Expand Down
10 changes: 4 additions & 6 deletions doorstop/core/importer.py
Expand Up @@ -2,21 +2,19 @@

"""Functions to import exiting documents and items."""

import csv
import os
import re
import csv
import warnings

import openpyxl

from doorstop import common
from doorstop import common, settings
from doorstop.common import DoorstopError
from doorstop.core.types import UID
from doorstop.core.builder import _get_tree
from doorstop.core.document import Document
from doorstop.core.item import Item
from doorstop.core.builder import _get_tree
from doorstop import settings

from doorstop.core.types import UID

LIST_SEP_RE = re.compile(r"[\s;,]+") # regex to split list strings into parts

Expand Down
15 changes: 6 additions & 9 deletions doorstop/core/item.py
Expand Up @@ -2,21 +2,18 @@

"""Representation of an item in a document."""

import functools
import os
import re
import functools

import pyficache

from doorstop import common
from doorstop.common import DoorstopError, DoorstopWarning, DoorstopInfo
from doorstop.core.base import (add_item, edit_item, delete_item,
auto_load, auto_save,
BaseValidatable, BaseFileObject)
from doorstop.core.types import Prefix, UID, Text, Level, Stamp, to_bool
from doorstop import common, settings
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
from doorstop.core import editor
from doorstop import settings

from doorstop.core.base import (BaseFileObject, BaseValidatable, add_item,
auto_load, auto_save, delete_item, edit_item)
from doorstop.core.types import UID, Level, Prefix, Stamp, Text, to_bool

log = common.logger(__name__)

Expand Down
12 changes: 5 additions & 7 deletions doorstop/core/publisher.py
Expand Up @@ -3,20 +3,18 @@
"""Functions to publish documents and items."""

import os
import textwrap
import tempfile
import textwrap

import markdown
from plantuml_markdown import PlantUMLMarkdownExtension

from doorstop import common
import bottle
from bottle import template as bottle_template
from doorstop import common, settings
from doorstop.common import DoorstopError
from doorstop.core.types import iter_documents, iter_items, is_tree, is_item
from doorstop import settings
from doorstop.core import Document

from bottle import template as bottle_template
import bottle
from doorstop.core.types import is_item, is_tree, iter_documents, iter_items

EXTENSIONS = (
'markdown.extensions.extra',
Expand Down
27 changes: 12 additions & 15 deletions doorstop/core/tests/test_all.py
Expand Up @@ -4,29 +4,26 @@

# pylint: disable=protected-access,unidiomatic-typecheck

import unittest
from unittest.mock import patch, Mock

import os
import csv
import tempfile
import shutil
import pprint
import logging
import os
import pprint
import shutil
import tempfile
import unittest
import warnings
from unittest.mock import Mock, patch

import yaml
import openpyxl
import yaml

from doorstop import common
from doorstop.common import DoorstopError, DoorstopWarning, DoorstopInfo
from doorstop import core
from doorstop.core.builder import _get_tree, _clear_tree
from doorstop import common, core
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
from doorstop.core.builder import _clear_tree, _get_tree
from doorstop.core.tests import (EMPTY, ENV, FILES, FILES_BETA, REASON, ROOT,
SYS, DocumentNoSkip)
from doorstop.core.vcs import mockvcs

from doorstop.core.tests import ENV, REASON, ROOT, FILES, EMPTY, SYS, FILES_BETA
from doorstop.core.tests import DocumentNoSkip

# Whenever the export format is changed:
# 1. set CHECK_EXPORTED_CONTENT to False
# 2. re-run all tests
Expand Down
9 changes: 4 additions & 5 deletions doorstop/core/tests/test_builder.py
Expand Up @@ -3,13 +3,12 @@
"""Unit tests for the doorstop.core.builder module."""

import unittest
from unittest.mock import patch, Mock
from unittest.mock import Mock, patch

from doorstop.core.builder import _clear_tree, build, find_document, find_item
from doorstop.core.tests import (EMPTY, FILES, MockDocumentNoSkip,
MockDocumentSkip)
from doorstop.core.tree import Tree
from doorstop.core.builder import build, find_document, find_item, _clear_tree

from doorstop.core.tests import FILES, EMPTY
from doorstop.core.tests import MockDocumentSkip, MockDocumentNoSkip


class TestModule(unittest.TestCase):
Expand Down

0 comments on commit b3cc641

Please sign in to comment.