question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set styler config?

See original GitHub issue

Below is my user config for formatter.

{    
    // Code Formatter Preferences
    // Preferences for this plugin
    "preferences": {
        "default_formatter": {
            "python": ["isort", "yapf"],
            "r": "formatR"
        }
    },
    
    // YAPF
    "yapf":{
        "style_config": "facebook"
    }
}

I down’t want to place each dictionary entry onto its own line. So I looked into Github and find this command:

# Place each dictionary entry onto its own line.
#each_dict_entry_on_separate_line = False

However, it occurred an error when setting to jupyterlab user preference. So I looked into Doc. It says I can browse (http://localhost:8888/jupyterlab_code_formatter/formatters) to find out what formatters are available. But I get a 422 error code when browse it.

So how can I setting each_dict_entry_on_separate_line = False? Hope to hear from you ASAP, thanks a lot!

(base) C:\Windows\system32>pip freeze
WARNING: Could not generate requirement for distribution -ocutils 0.16 (c:\programdata\anaconda3\lib\site-packages): Parse error at "'-ocutils'": Expected W:(abcd...)
alabaster==0.7.12
altair==4.1.0
anaconda-client==1.7.2
anaconda-navigator==1.9.12
anaconda-project==0.8.3
appdirs==1.4.3
argh==0.26.2
asn1crypto==1.3.0
astor==0.8.1
astroid @ file:///C:/ci/astroid_1592481955828/work
astropy==4.0.1.post1
atomicwrites==1.4.0
attrs==19.3.0
autopep8 @ file:///tmp/build/80754af9/autopep8_1592412889138/work
Babel==2.8.0
backcall==0.2.0
backports.functools-lru-cache==1.6.1
backports.shutil-get-terminal-size==1.0.0
backports.tempfile==1.0
backports.weakref==1.0.post1
base58==2.0.0
bcrypt==3.1.7
beautifulsoup4==4.9.1
bitarray==1.2.2
bkcharts==0.2
black==19.10b0
bleach==3.1.5
blinker==1.4
bokeh==2.1.0
boto==2.49.0
boto3==1.12.39
botocore==1.15.39
Bottleneck==1.3.2
brotlipy==0.7.0
cachetools==4.1.0
certifi==2020.4.5.2
cffi==1.14.0
chardet==3.0.4
click==7.1.2
cloudpickle==1.4.1
clyent==1.2.2
colorama==0.4.3
comtypes==1.1.7
conda==4.8.3
conda-build==3.18.11
conda-package-handling==1.7.0
conda-verify==3.4.2
contextlib2==0.6.0.post1
cryptography==2.9.2
cycler==0.10.0
Cython==0.29.20
cytoolz==0.10.1
dask==2.18.1
decorator==4.4.2
defusedxml==0.6.0
diff-match-patch==20181111
distributed==2.18.0
docutils==0.16
entrypoints==0.3
enum-compat==0.0.3
et-xmlfile==1.0.1
fastcache==1.1.0
filelock==3.0.12
flake8==3.8.3
Flask==1.1.2
fsspec==0.7.4
future==0.18.2
gevent==1.4.0
glob2==0.7
greenlet==0.4.16
h5py==2.10.0
HeapDict==1.0.1
html5lib==1.0.1
hypothesis==5.16.1
idna==2.9
imageio==2.8.0
imagesize==1.2.0
importlib-metadata==1.6.1
intervaltree==3.0.2
ipykernel==5.3.0
ipympl==0.5.6
ipython @ file:///C:/ci/ipython_1592330400575/work
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==4.3.21
itsdangerous==1.1.0
jdcal==1.4.1
jedi==0.15.2
Jinja2==2.11.2
jmespath==0.9.5
joblib==0.15.1
json5==0.9.5
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.3
jupyter-console==6.1.0
jupyter-core==4.6.3
jupyterlab==2.1.4
jupyterlab-code-formatter==1.1.0
jupyterlab-server==1.1.5
keyring==21.1.1
kiwisolver==1.2.0
lazy-object-proxy==1.4.3
libarchive-c==2.9
llvmlite==0.32.1
locket==0.2.0
lxml==4.5.1
MarkupSafe==1.1.1
matplotlib @ file:///C:/ci/matplotlib-base_1592401131947/work
mccabe==0.6.1
menuinst==1.4.16
mistune==0.8.4
mkl-fft==1.1.0
mkl-random==1.1.1
mkl-service==2.3.0
mock==4.0.2
more-itertools==8.4.0
mpmath==1.1.0
msgpack==1.0.0
multipledispatch==0.6.0
mypy-extensions==0.4.3
navigator-updater==0.2.1
nbconvert==5.6.1
nbformat==5.0.7
networkx==2.4
nltk @ file:///tmp/build/80754af9/nltk_1592496090529/work
nose==1.3.7
notebook==6.0.3
numba==0.49.1
numexpr==2.7.1
numpy==1.18.1
numpydoc==1.0.0
olefile==0.46
openpyxl==3.0.3
packaging==20.4
pandas==1.0.4
pandocfilters==1.4.2
paramiko==2.7.1
parso==0.5.2
partd==1.1.0
path==13.1.0
pathlib2==2.3.5
pathspec==0.7.0
pathtools==0.1.2
patsy==0.5.1
pep8==1.7.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.1.2
pkginfo==1.5.0.1
pluggy==0.13.1
ply==3.11
prometheus-client==0.8.0
prompt-toolkit==3.0.5
protobuf==3.11.3
psutil==5.7.0
py==1.8.2
pycodestyle==2.6.0
pycosat==0.6.3
pycparser==2.20
pycrypto==2.6.1
pycurl==7.43.0.5
pydeck==0.3.0
pydocstyle==4.0.1
pyflakes==2.2.0
Pygments==2.6.1
pylint @ file:///C:/ci/pylint_1592487534522/work
PyNaCl==1.3.0
pyodbc===4.0.0-unsupported
pyOpenSSL==19.1.0
pyparsing==2.4.7
pyreadline==2.1
pyrsistent==0.16.0
PySocks==1.7.1
pytest==5.4.3
pytest-arraydiff==0.3
pytest-astropy==0.8.0
pytest-astropy-header==0.1.2
pytest-doctestplus==0.7.0
pytest-openfiles==0.5.0
pytest-remotedata==0.3.2
python-dateutil==2.8.1
python-docx==0.8.10
python-jsonrpc-server==0.3.4
python-language-server==0.31.9
pytz==2020.1
PyWavelets==1.1.1
pywin32==227
pywin32-ctypes==0.2.0
pywinpty==0.5.7
PyYAML==5.3.1
pyzmq==18.1.1
QDarkStyle==2.8.1
QtAwesome==0.7.2
qtconsole==4.7.4
QtPy==1.9.0
regex==2020.5.14
requests==2.23.0
rope==0.17.0
Rtree==0.9.4
ruamel-yaml==0.15.87
s3transfer==0.3.3
scikit-image==0.16.2
scikit-learn==0.22.1
scipy==1.4.1
seaborn==0.10.1
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.15.0
snowballstemmer==2.0.0
sortedcollections==1.2.1
sortedcontainers==2.2.2
soupsieve==2.0.1
Sphinx==3.0.4
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sphinxcontrib-websupport==1.2.1
spyder==4.1.3
spyder-kernels==1.9.1
SQLAlchemy==1.3.17
statsmodels==0.11.1
streamlit==0.57.3
sympy==1.6
tables==3.6.1
tblib==1.6.0
terminado==0.8.3
testpath==0.4.4
toml==0.10.0
toolz==0.10.0
tornado==6.0.4
tqdm==4.46.1
traitlets==4.3.3
typed-ast==1.4.1
typing-extensions==3.7.4.1
tzlocal==2.0.0
ujson==1.35
unicodecsv==0.14.1
urllib3==1.25.9
validators==0.14.3
watchdog==0.10.2
wcwidth==0.2.4
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
win-inet-pton==1.1.0
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.11.2
xlrd==1.2.0
XlsxWriter==1.2.9
xlwings==0.19.4
xlwt==1.3.0
xmltodict==0.12.0
yapf==0.28.0
zict==2.0.0
zipp==3.1.0
(base) C:\Windows\system32>jupyter labextension list
JupyterLab v2.1.4
Known labextensions:
   app dir: C:\ProgramData\Anaconda3\share\jupyter\lab
        @jupyter-widgets/jupyterlab-manager v2.0.0 enabled  ok
        @jupyterlab/toc v4.0.0 enabled  ok
        @krassowski/jupyterlab_go_to_definition v1.0.0 enabled  ok
        @lckr/jupyterlab_variableinspector v0.4.0 enabled  ok
        @ryantam626/jupyterlab_code_formatter v1.3.1 enabled  ok
        jupyter-matplotlib v0.7.2 enabled  ok
(base) C:\Windows\system32>jupyter serverextension list
config dir: C:\Users\alston\.jupyter
    jupyterlab_code_formatter enabled
    - Validating...
      jupyterlab_code_formatter  ok
config dir: C:\ProgramData\Anaconda3\etc\jupyter
    jupyterlab enabled
    - Validating...
      jupyterlab 2.1.4 ok
    jupyterlab_code_formatter enabled
    - Validating...
      jupyterlab_code_formatter  ok

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ryantam626commented, Jul 10, 2020

Oh I mean download thisyapf config file from https://gist.github.com/krnd/3b8c5834c5c5c5097638ec10729787f7#file-style-yapf since you seemed to want to use that.

Anyway, since it’s working for you right now, I am closing this issue 👍

0reactions
alston19commented, Jun 27, 2020

Actually, style_config can be a path to a yapf config file, so it is available after all. Download that yapf config you want to use and point style_config to it.

Thank you so much. It’s so kind of you. 😃 I followed your suggestion but I don’t know how to retrieve a yapf config file. So I directly changed C:\ProgramData\Anaconda3\lib\site-packages\yapf\yapflib\style.py and now it works well. Thank you again and please accept my apology for replying so late.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XAML Styler Configuration · Xavalon/XamlStyler Wiki - GitHub
Defines location of external XAML Styler configuration file. Specifying an external configuration file allows you to easily point multiple ...
Read more >
Table Visualization — pandas 1.5.2 documentation - PyData |
We will create internal CSS classes as before using table styles. Setting classes always overwrites so we need to make sure we add...
Read more >
styler 1.0.0 - Tidyverse
styler can style text, single files, packages and entire R source trees with the following functions: style_text() styles a character vector.
Read more >
Setting up Content Styler - D2L
Setting up Content Styler · From the Organization home page, click Admin Tools · Under Organization Related, click Config Variable Browser. · Browse...
Read more >
coding style - R styler addin: how to setup? - Stack Overflow
Maybe you need to restart the IDE after installation. Also, check the R prompt for messages and outputs. Note that for styler <...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found