for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import os
import glob
import markdown
markdown
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
try: # python3 ftw !
from StringIO import StringIO
except ImportError:
from io import StringIO
from flask import Blueprint, render_template, redirect
flask
docs = Blueprint('docs', __name__)
docs
(([A-Z_][A-Z0-9_]*)|(__.*__))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
def __render_md(md_file):
"""
:param str md_file: Path to a markdown file
:return str: html rendering of the `md_file` markdown file
ret = StringIO()
markdown.markdownFromFile(input=md_file, output=ret, encoding='utf-8')
return ret.getvalue()
@docs.route("/")
def index():
return render_template("docs/index.html", data=__render_md("docs/docs.md"))
@docs.route("/<path:doc_file>")
def display(doc_file):
if doc_file == 'README.md':
doc_path = 'README.md'
else:
doc_path = os.path.join("docs", doc_file)
if doc_path not in glob.glob("docs/*.md"):
return redirect('/docs')
return render_template("docs/index.html", data=__render_md(doc_path), title='<a href="/docs">Spike - Docs</a>')
This check looks for lines that are too long. You can specify the maximum line length.
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.