Commit Graph

677 Commits

Author SHA1 Message Date
Dionisio E Alonso e93b853fa9 Merge branch 'pylsp-settings' 2024-03-02 18:12:30 -03:00
Dionisio E Alonso b15b9178c6 feat(LSP): Modify the way a virtual env is located
Changed the hard-coded virtual environment directory name used to look
for Python related binaries to whatever directory is defined in the
`VIRTUAL_ENV` environment variable.  That variable's value is more
reliable, even more when Python virtual environments are located in a
central location, not near the repository.
2024-03-02 17:29:42 -03:00
Dionisio E Alonso 8d626d2188 feat(LSP): Refactor alternative executables for linters
Test for new executables, for different checkers, for Python LSP only if
the virtual environment directory has been found.

The previous behavior could have found executables for such linters on
different places, as they could have been appearing outside a virtual
environment directory (if the `venv_dir` variable tested as an empty
string).  Such behavior could lead to undefined behaviors.
2024-03-02 17:17:53 -03:00
Dionisio E Alonso 8418e53327 feat(LSP): Change default python executable
On most Linux distros python3 is the default, even more, there is no
Python version 2 to be installed anyways, hence there is no need to
distinguish which python version to load anymore.

The default python executable has come to be `python` even though the
Python version is 3.x.  Furthermore, on all virtual environments
`python` exists and is linked to point to a Python 3.x executable.
2024-03-02 17:00:09 -03:00
Dionisio E Alonso fe8b7b0238 feat(LSP): Delete unnecessary settings
Third-party installed plugins are enabled by default, hence there is no
need to explicitly enable it.

Ruff plugin doesn't come with standard PyLSP, and is one (along with
pylsp-mypy) of the manually added plugins.
2024-02-26 12:43:53 -03:00
Dionisio E Alonso bd435b7730 feat(template): Make pre-commit hooks read configs from config files
When possible, for pre-commit hooks, instead of receiving arguments via
command line, make them read their config from a configuration file to
achieve the same behavior as invoking the corresponding tool outside
pre-commit.
2024-02-26 11:32:51 -03:00
Dionisio E Alonso 5d6c98a528 feat(templates): Reorganise some hook's arguments
Some of the arguments in the pip-tools hook were for an older version of
the hook, which didn't work with pyproject.toml files.

Since Python 3.6 is long deprecated now, the template is being bumped at
least to the 3.7 version.
2024-02-26 11:22:07 -03:00
Dionisio E Alonso 695f0977d6 feat(templates): Add new python hook for pre-commit
For the pre-commit-config.yaml added the Ruff hook and, as Ruff is being
configured via TOML file instead of inline command line arguments, also
added the toml checker.
2024-02-26 11:18:36 -03:00
Dionisio E Alonso a22d0b22d1 Merge branch 'pylsp-settings' 2024-02-26 11:11:06 -03:00
Dionisio E Alonso d89fbb2f40 feat(LSP): Reorganise PyLSP blocks of code
Although the block of code moved is programmatic configuration taking
place before the actual on/off of settings (which could be interpreted
as metadata config), the block of code in question had nothing to do
with the setting of other LSPs than PyLSP.

The whole block is for pre-installing plugins for PyLSP server, or its
plugins'.
2024-02-26 10:00:09 -03:00
Dionisio E Alonso 41115cdd19 feat(LSP): Override pretty flag for Mypy
As the `--pretty` flat for Mypy provides nicer output, the soft word
wrap it uses makes editors receive part of the message.  Hence the
setting has to be overridden inside editors (the flag is kept on
because invoking Mypy from terminal benefits from the extra output
information).
2024-02-25 23:00:39 -03:00
Dionisio E Alonso 1493b3ceb5 feat(LSP): Move some comments between config files
Some Pylint settings that are more probable to occur on medium-big
projects were move to the pyproject.toml template, in order to have it
near when a new project is started.

On the other hand, those checks were never going to be on for regular
Python programming.
2024-02-24 20:37:50 -03:00
Dionisio E Alonso 85838e4521 feat(LSP): Delete unnecessary line in configs
The deleted line was already commented out.  There is no need for the
line anyways as the mccabe plugin comes already disabled by default.

Furthermore the option is a duplication, enabling the plugin and setting
a value to the `threshold` has the same effect as setting the
`maxComplexity` value on Flake8's plugin.

The only distinction is McCabe came, when enabled, with a default preset
value of 15 for `threshold`, which Flake8 hasn't for `maxComplexity`.
2024-02-24 14:03:39 -03:00
Dionisio E Alonso 773acf8ec4 feat(LSP): Correct Ruff config section to mimic covered linters
In order to make Ruff report, the best way possible, mimicking the
reports provided by both Flake8 and Pylint, disable some of the checks
that the latter linters don't have turned on by default.
2024-02-23 17:59:03 -03:00
Dionisio E Alonso 11a1962f09 feat(LSP): Correct Pylint's configuration indentation
Unify Pylint's config indentation like any other TOML file in this repo.
2024-02-23 17:51:36 -03:00
Dionisio E Alonso 4dfdba8ac7 feat(LSP): Bump configuration for Ruff
With latest Ruff version, some of the settings in the configuration
files were relocated.  This patch corrects those category names.
2024-02-23 17:42:29 -03:00
Dionisio E Alonso a1dbef0b64 feat(LSP): Copy behavior for Mypy on pyproject
The results achieved in the Mypy config files, translate them to the
pyproject.toml in order to have the very same behavior.
2024-02-23 17:39:06 -03:00
Dionisio E Alonso e139152080 Merge branch 'pylsp-settings' 2024-02-06 09:02:46 -03:00
Dionisio E Alonso b887f0b9ae feat(LSP): Add nice pretty output for Mypy 2024-02-06 09:02:19 -03:00
Dionisio E Alonso 7dfa03eb73 feat(LSP): Delete default flag from config
The flag being deleted already has its default value set to what was on
the configuration file.  Having the configuration was redundant.
2024-02-06 09:02:03 -03:00
Dionisio E Alonso 52cd15c96d feat(emacs): Upgrade package initialization syntax
Previously used syntax for adding Melpa's repository to Emacs was taken
from Melpa's site itself.  But some of those commands have become
standard Emacs that load on Emacs startup.  This changes are to make use
of newer techniques for incorporating 3rd party repos into Emacs.
2024-02-06 08:12:08 -03:00
Dionisio E Alonso f248c257bd fix(LSP): Correct pylsp configuration syntax
Eglot's configuration for LSP servers does not have a “false” literal in
Lisp.  Furthermore, the previously used `nil` value was being mapped to
JSON's `null` value instead of `false`; making the LSP server to load
defaults for those settings instead of setting those settings to false.
2024-02-06 08:08:24 -03:00
Dionisio E Alonso 6b5452f9d1 feat(LSP): Add pylint executable explicitly
Without telling python-lsp-server which the pylint executable is,
explicitly, the plugin never runs.  This modification ensures the plugin
is running.
2024-02-06 08:06:18 -03:00
Dionisio E Alonso aeaf9bc692 Merge branch 'pylsp-settings' 2024-02-04 18:36:39 -03:00
Dionisio E Alonso 54938dd02c feat(LSP): Add PyLSP configurations for eglot
Replicate the same base configuration used for python-lsp-server in
Neovim but for Emacs's Eglot LSP client.
2024-02-04 18:33:28 -03:00
Dionisio E Alonso af5a35e874 Merge branch 'emacs-refactor' into pylsp-settings 2024-02-04 18:28:04 -03:00
Dionisio E Alonso 6d2951b2b1 feat(LSP): Amend documentation
This is a minimal correction on the comments documenting the use of the
file.
2024-02-04 18:26:15 -03:00
Dionisio E Alonso 00a57f889c feat(mypy): Change configuration format
Changed mypy configuration INI format.  Python's configparser checks
boolean values in a case-insensitive manner, so it doesn't matter if
values start in Title-case or lower-case.  This way, the configuration
is easily translated to TOML format for writing a pyproject.toml file;
with the exception of string values which will have to be enclosed in
quotes anyways.
2024-02-04 18:20:09 -03:00
Dionisio E Alonso b3ff8ceca0 Merge branch 'emacs-refactor' 2024-02-03 20:32:37 -03:00
Dionisio E Alonso e5a65b3ea9 feat(emacs): Add some LSP functionality to Emacs
This feature requires for LSP servers to be already installed, and the
PATH variable to point to where the executables reside.
2024-02-03 20:30:16 -03:00
Dionisio E Alonso 13920d3841 feat(emacs): Delete unused option for typeface 2024-02-03 20:20:43 -03:00
Dionisio E Alonso 4ef1f32186 feat(emacs): Setup some packages for emacs
Similar to a plugin manager, Emacs has Elpa and Melpa repos.  Here,
Melpa repository is being added and then some packages (themes and
languages' modes) provided by that repo.
2024-02-03 20:17:30 -03:00
Dionisio E Alonso 7f3a8deede Merge branch 'emacs-refactor' 2024-02-03 15:40:51 -03:00
Dionisio E Alonso 584deb9575 feat(emacs): Remember last cursor position per file 2024-02-03 15:11:14 -03:00
Dionisio E Alonso a272a609a3 feat(emacs): Split lines in setting for readability 2024-02-03 15:08:07 -03:00
Dionisio E Alonso 881a3b70ce feat(emacs): Move font attributes outside custom-set-font
As with previous change, the custom-set-font interface reorders stuff
it's own way.  Moving this settings outside that scope makes the
settings stay put.
2024-02-03 15:08:07 -03:00
Dionisio E Alonso 7a260bf0da feat(emacs): Move settings outside customize
Emacs customization interface has it's own way to sort settings out.
With this change, the same settings' effects are achieved manually
without having to rely on the internal sorting the customize interface
intends.
2024-02-03 15:03:17 -03:00
Dionisio E Alonso cd10517361 Merge branch 'pylsp-settings' 2024-01-31 00:24:49 -03:00
Dionisio E Alonso 848d6377f1 feat(mypy): Change configuration format
Changed mypy configuration file format from INI to TOML.  It works all
the same and in this way there are more similarities with the format
inside pyproject.toml file.
2024-01-31 00:22:20 -03:00
Dionisio E Alonso 07b3b2a6df Merge branch 'master' into pylsp-settings 2024-01-31 00:21:38 -03:00
Dionisio E Alonso 1ca997c674 feat(mypy): Reorder some options in preference order 2024-01-31 00:20:04 -03:00
Dionisio E Alonso 9a003190ed feat(Vim): Turn off folding display by default 2024-01-29 05:47:24 -03:00
Dionisio E Alonso ea03e3300a feat(Neovim): Correct folding options
The function that added nice text for folded blocks was reverted in
https://github.com/neovim/neovim/pull/27217 in favor of the default text
generated by setting the folding-text option to `""`.
2024-01-29 05:43:31 -03:00
Dionisio E Alonso 1d2aa742e8 Merge branch 'refactor-lua-configs' 2024-01-26 13:53:22 -03:00
Dionisio E Alonso bd061bf7b3 feat(LSP): Delete unused variables
There is no need for these variables under this auto-command.
2024-01-26 13:50:01 -03:00
Dionisio E Alonso 97e4052934 feat(LSP): Delete erroneous argument `buffer`
The argument `buffer` us used for another type of autocmd's, those with
whole buffer scope.
2024-01-26 13:48:02 -03:00
Dionisio E Alonso 5971e6e019 feat(shells): Add an alias for vi to run nvim
This fallback is in case an app ignores the `EDITOR` env variable, and
directly runs the command `vi` as a default for tui text editor.
2024-01-26 12:30:44 -03:00
Dionisio E Alonso ae1d9a6043 feat(Fish): Set default editor to Neovim
Using the recommendation in the FAQ
(https://fishshell.com/docs/current/faq.html#why-doesn-t-set-ux-exported-universal-variables-seem-to-work),
set the `EDITOR` environment variable to `nvim`.
2024-01-26 10:04:08 -03:00
Dionisio E Alonso 72fc1f4244 feat(Vim): Add some extra folding functionality
Not quite working yet, but is the first attempt to mimic Treesitter's
functionality in Neovim.
2024-01-25 20:44:23 -03:00
Dionisio E Alonso fb843d5dbc Merge branch 'refactor-lua-configs' 2024-01-25 13:15:26 -03:00