-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Add remote support #1922
base: master
Are you sure you want to change the base?
Add remote support #1922
Commits on Apr 28, 2024
-
Fix running checkers on remote hosts via TRAMP.
This patch does three things: * Update `flycheck-default-executable-find` to search remote hosts when `default-directory` is a remote directory. See also the documentation for [executable-find](https://www.gnu.org/software/emacs/manual/html_node/elisp/Locating-Files.html). * Change uses of `call-process` and `start-process` to `start-file-process` which is the same as these two functions, but starts the process on a remote host when `default-directory` is a remote directory. See also the documentation for [start-file-process](https://www.gnu.org/software/emacs/manual/html_node/elisp/Asynchronous-Processes.html). * Passes the local part of `buffer-file-name` to the compile command, e.g. strips `/ssh:10.0.0.42`, since the checker is run on the remote machine where the file name must be local. See also the documentation for [file-local-name](https://www.gnu.org/software/emacs/manual/html_node/elisp/Magic-File-Names.html).
Configuration menu - View commit details
-
Copy full SHA for fe53f87 - Browse repository at this point
Copy the full SHA fe53f87View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5d026c - Browse repository at this point
Copy the full SHA f5d026cView commit details -
Configuration menu - View commit details
-
Copy full SHA for fdeaef3 - Browse repository at this point
Copy the full SHA fdeaef3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f34c5b - Browse repository at this point
Copy the full SHA 5f34c5bView commit details -
Such checkers (including python-pycompile) use a temp directory. For executing flycheck on remote files, temp directories should be created on remote.
Configuration menu - View commit details
-
Copy full SHA for b9ecc69 - Browse repository at this point
Copy the full SHA b9ecc69View commit details -
Make default error-parser return `flycheck-error' with local path
Some checkers (including python-flake8 and python-pycompile) use flycheck-parse-error-with-patterns as their error-parser. This commit changes `flycheck-parse-error-with-patterns' behavior so that it always returns `flycheck-error' struct with its :filename slot in the form of local path on remote files (i.e., without "/method:user@host:" part).
Configuration menu - View commit details
-
Copy full SHA for cb3ac3d - Browse repository at this point
Copy the full SHA cb3ac3dView commit details -
Convert filename in `flycheck-error' to local path
Some checkers set remote path or filename (without directory path) to `flycheck-error' struct's :filename slot. For example, on remote files, python-pylint sets remote path (i.e., with "/method:user@host:" part). python-flake8 before the previous comiit also sets remote path. py-compile sets filename only. In all these cases, after processing with `flycheck-fill-and-expand-error-file-names', :filename slot of `flycheck-error' struct was remote path. This commit changes `flycheck-fill-and-expand-error-file-names' behavior so that it always returns `flycheck-error' struct with its :filename slot in the form of local path on remote files (i.e., without "/method:user@host:" part).
Configuration menu - View commit details
-
Copy full SHA for 9982caa - Browse repository at this point
Copy the full SHA 9982caaView commit details -
Make flycheck temp file on remote and report its local path
Some checkers (including python-pylint) use `flycheck-save-buffer-to-temp' to create temp file. For executing flycheck on remote files, their corresponding temp files should be created on remote (therefore, they should be specified as remote path, i.e., with "/method:user@host:" part). On the other hand, the return value of `flycheck-save-buffer-to-temp' should be local path (i.e., without "/method:user@host:" part) because the value is used as an argument to checker's executable.
Configuration menu - View commit details
-
Copy full SHA for 539b4df - Browse repository at this point
Copy the full SHA 539b4dfView commit details -
Enable flycheck to find remote config file
Flycheck uses `flycheck-locate-config-file-functions' to locate config file. Its value is the list of functions below: - flycheck-locate-config-file-by-path - flycheck-locate-config-file-ancestor-directories - flycheck-locate-config-file-home Each locate function should use remote path (i.e., with "/method:user@host:" part) to locate a config file. When the return value is used as an argument to a checker's executable, the path should be converted to local path (i.e., without "/method:user@host:" part). Tested with python-flake8 and python-pylint.
Configuration menu - View commit details
-
Copy full SHA for df4adab - Browse repository at this point
Copy the full SHA df4adabView commit details -
Enable *-stylelint to work on remote files by using temporary file
The original version used stdin instead of a temporary file (as with javascript-eslint). However, behavior of eslint and stylelint is different in terms of stdin processing. Corresponding CLI commands for both tools are: eslint: eslint --format=json --stdin --stdin-filename FILENAME-TO-ASSIGN-TO-STDIN stylelint: stylelint --formatter json --stdin-filename FILENAME-TO-ASSIGN-TO-STDIN or stylelint --formatter json --stdin --stdin-filename FILENAME-TO-ASSIGN-TO-STDIN eslint waits for stdin EOF and keeps itself alive, while stylelint does not wait and may exit before input comes in. When stylelint does not receive stdin, it emits its usage message (when --stdin is not specified) or outputs "empty source" lint message (when --stdin is specified). For local files, the original version was able to pass input with `flycheck-process-send-buffer' before stylelint process exited. For remote files, stylelint process exited before `flycheck-process-send-buffer' called. This commit changes *-styelint commands so that they use a temporary file (instead of stdin) as their input to avoid the above situation on remote.
Configuration menu - View commit details
-
Copy full SHA for 5a9b765 - Browse repository at this point
Copy the full SHA 5a9b765View commit details -
Add a file-local-name wrapper function that accepts nil argument
To add support for remote files, some occurrences of filenames had to be converted to local path on remote (i.e., without "/method:user@host:" part). However, these filenames could be nil, while file-local-name signals an error when its argument is nil. This led to test failure for scss-lint and others. (Test command: "make LANGUAGE=scss integ") This commit adds a wrapper function of file-local-name that accepts nil as its argument and return it as it is.
Configuration menu - View commit details
-
Copy full SHA for 8cabec3 - Browse repository at this point
Copy the full SHA 8cabec3View commit details -
Replace all file-local-name with file-local-name-pass-nil
Replace all occurrences is excessive. For example, arguments to checker executables are not expected to be nil and thus file-local-name will suffice. However, here, all occurrences are replaced just in case.
Configuration menu - View commit details
-
Copy full SHA for 877697b - Browse repository at this point
Copy the full SHA 877697bView commit details -
Return local home when buffer-file-name returns nil
In `flycheck-locate-config-file-home', file-remote-p is used to determine if the context is local or remote. Because file-remote-p does not accept nil, (file-remote-p (buffer-file-name)) may cause an error. It led to unit test failure: FAILED flycheck-locate-config-file/existing-file-in-home-directory FAILED flycheck-locate-config-file/existing-file-in-parent-directory FAILED flycheck-locate-config-file/not-existing-file This commit adds a nil-check for buffer-file-name. When buffer-file-name returns nil, the context is assumed to be local.
Configuration menu - View commit details
-
Copy full SHA for f4d8d57 - Browse repository at this point
Copy the full SHA f4d8d57View commit details -
Add workaround for Emacs<=25.3
integ test for Emacs25.3 failed due to undefined functions. Error: the following functions are not known to be defined: file-local-name, temporary-file-directory This commit fixes the problem by reverting to the original codes when the functions are not available.
Configuration menu - View commit details
-
Copy full SHA for e65472b - Browse repository at this point
Copy the full SHA e65472bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 960a0ab - Browse repository at this point
Copy the full SHA 960a0abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c1efa7 - Browse repository at this point
Copy the full SHA 7c1efa7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 75cac2d - Browse repository at this point
Copy the full SHA 75cac2dView commit details
Commits on Apr 30, 2024
-
Suppress flake8's colored outputs
The outputs of flake8 are parsed by flycheck-parse-with-patterns, which does not take ASCII escape sequences into account. Therefore, flake8 should return simple texts (without escape sequences).
Configuration menu - View commit details
-
Copy full SHA for d766cd5 - Browse repository at this point
Copy the full SHA d766cd5View commit details