Exemplo n.º 1
0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
import os
import sys

from flake8 import LOG
from flake8.api.legacy import get_style_guide

# suppress warning messages from flake8
LOG.setLevel(logging.ERROR)


def test_flake8():
    style_guide = get_style_guide(
        extend_ignore=['D100', 'D104', 'W503'],
        show_source=True,
    )
    style_guide_tests = get_style_guide(
        extend_ignore=['D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D107'],
        show_source=True,
    )

    report = style_guide.check_files([
        os.path.join(os.path.dirname(__file__), '..', 'rosdoc2'),
    ])
Exemplo n.º 2
0
# Copyright 2016-2018 Dirk Thomas
# Copyright 2018 Mickael Gaillard
# Licensed under the Apache License, Version 2.0

import logging
from pathlib import Path
import sys

from flake8 import LOG
from flake8.api.legacy import get_style_guide

# avoid debug and info messages from flake8 internals
LOG.setLevel(logging.WARN)


def test_flake8():
    style_guide = get_style_guide(
        ignore=['D100', 'D104'],
        show_source=True,
    )
    style_guide_tests = get_style_guide(
        ignore=['D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D107'],
        show_source=True,
    )

    stdout = sys.stdout
    sys.stdout = sys.stderr
    # implicitly calls report_errors()
    report = style_guide.check_files([
        str(Path(__file__).parents[1] / 'colcon_cmake'),
    ])
# Copyright 2016-2018 Dirk Thomas
# Licensed under the Apache License, Version 2.0

import logging
from pathlib import Path
import sys

from flake8 import LOG
from flake8.api.legacy import get_style_guide
from pydocstyle.utils import log

# avoid debug and info messages from flake8 internals
LOG.setLevel(logging.WARNING)


def test_flake8():
    # for some reason the pydocstyle logger changes to an effective level of 1
    # set higher level to prevent the output to be flooded with debug messages
    log.setLevel(logging.WARNING)

    style_guide = get_style_guide(
        extend_ignore=['D100', 'D104'],
        show_source=True,
    )
    style_guide_tests = get_style_guide(
        extend_ignore=['D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D107'],
        show_source=True,
    )

    stdout = sys.stdout
    sys.stdout = sys.stderr