Skip to content

Disable Autopep8 and Yapf if this plugin is installed #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
exclude: fixtures
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pip install python-lsp-black

# Usage

To avoid unexpected results you should make sure `yapf` and `autopep8` are not installed.
This plugin will disable the yapf and autopep8 plugins if installed.

- `python-lsp-black` can either format an entire file or just the selected text.
- The code will only be formatted if it is syntactically valid Python.
Expand Down
4 changes: 3 additions & 1 deletion pylsp_black/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def pylsp_settings():
"line_length": 88,
"preview": False,
"cache_config": False,
}
},
"yapf": {"enabled": False},
"autopep8": {"enabled": False},
}
}

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers =

[options]
packages = find:
install_requires = python-lsp-server>=1.4.0; black>=22.1.0; toml
install_requires = python-lsp-server>=1.4.0; black>=22.3.0; toml
python_requires = >= 3.7

[options.entry_points]
Expand Down