Merge branch 'bugfix/python_lint_v4.0' into 'release/v4.0'

tools: fix python lint (v4.0)

See merge request espressif/esp-idf!9301
This commit is contained in:
Anton Maklakov 2020-06-24 16:05:54 +08:00
commit 4f22be795d
5 changed files with 23 additions and 15 deletions

View File

@ -242,11 +242,11 @@ pygments_style = 'sphinx'
# Redirects should be listed in page_redirects.xt # Redirects should be listed in page_redirects.xt
# #
with open("../page_redirects.txt") as f: with open("../page_redirects.txt") as f:
lines = [re.sub(" +", " ", l.strip()) for l in f.readlines() if l.strip() != "" and not l.startswith("#")] lines = [re.sub(" +", " ", line.strip()) for line in f.readlines() if line.strip() != "" and not line.startswith("#")]
for line in lines: # check for well-formed entries for line in lines: # check for well-formed entries
if len(line.split(' ')) != 2: if len(line.split(' ')) != 2:
raise RuntimeError("Invalid line in page_redirects.txt: %s" % line) raise RuntimeError("Invalid line in page_redirects.txt: %s" % line)
html_redirect_pages = [tuple(l.split(' ')) for l in lines] html_redirect_pages = [tuple(line.split(' ')) for line in lines]
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.

View File

@ -6,15 +6,18 @@
# Importing conf_common adds all the non-language-specific # Importing conf_common adds all the non-language-specific
# parts to this conf module # parts to this conf module
import sys try:
import os from conf_common import * # noqa: F403,F401
sys.path.insert(0, os.path.abspath('..')) except ImportError:
from conf_common import * # noqa: F401, F403 - need to make available everything from common import sys
from local_util import download_file_if_missing # noqa: E402 - need to import from common folder import os
sys.path.insert(0, os.path.abspath('..'))
from conf_common import * # noqa: F403,F401
from local_util import download_file_if_missing # noqa: E402 - need to import from common folder
# General information about the project. # General information about the project.
project = u'ESP-IDF Programming Guide' project = u'ESP-IDF Programming Guide'
copyright = u'2016 - 2019, Espressif Systems (Shanghai) CO., LTD' copyright = u'2016 - 2020, Espressif Systems (Shanghai) CO., LTD'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -6,15 +6,18 @@
# Importing conf_common adds all the non-language-specific # Importing conf_common adds all the non-language-specific
# parts to this conf module # parts to this conf module
import sys try:
import os from conf_common import * # noqa: F403,F401
sys.path.insert(0, os.path.abspath('..')) except ImportError:
from conf_common import * # noqa: F401, F403 - need to make available everything from common import sys
from local_util import download_file_if_missing # noqa: E402 - need to import from common folder import os
sys.path.insert(0, os.path.abspath('..'))
from conf_common import * # noqa: F403,F401
from local_util import download_file_if_missing # noqa: E402 - need to import from common folder
# General information about the project. # General information about the project.
project = u'ESP-IDF 编程指南' project = u'ESP-IDF 编程指南'
copyright = u'2016 - 2019 乐鑫信息科技(上海)股份有限公司' copyright = u'2016 - 2020 乐鑫信息科技(上海)股份有限公司'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -34,6 +34,8 @@ from idf_http_server_test import test as client
# of large HTTP packets and malformed requests, running multiple parallel sessions, etc. # of large HTTP packets and malformed requests, running multiple parallel sessions, etc.
# It is advised that all these tests be run locally, when making changes or adding new # It is advised that all these tests be run locally, when making changes or adding new
# features to this component. # features to this component.
@ttfw_idf.idf_example_test(env_tag="Example_WIFI") @ttfw_idf.idf_example_test(env_tag="Example_WIFI")
def test_examples_protocol_http_server_advanced(env, extra_data): def test_examples_protocol_http_server_advanced(env, extra_data):
# Acquire DUT # Acquire DUT

View File

@ -13,7 +13,7 @@ PROTOCOL_VERSIONS = [1, 2]
def parse_testcases(version): def parse_testcases(version):
with open("testcases_v%d.txt" % version, "r") as f: with open("testcases_v%d.txt" % version, "r") as f:
cases = [l for l in f.readlines() if len(l.strip()) > 0] cases = [line for line in f.readlines() if len(line.strip()) > 0]
# Each 3 lines in the file should be formatted as: # Each 3 lines in the file should be formatted as:
# * Description of the test change # * Description of the test change
# * JSON "changes" to send to the server # * JSON "changes" to send to the server