fix: resolve byte-compiler warnings#128
Open
dannywillems wants to merge 6 commits into
Open
Conversation
Reflow docstrings that exceeded 80 columns so the byte-compiler no longer emits "docstring wider than 80 characters" warnings. Wording is preserved; only line breaks and minor phrasing changes were made.
Use `\='` to escape the literal leading single quotes that the byte-compiler flagged as "wrong usage of unescaped single quotes". The rendered docstrings are unchanged.
`cl-gensym` is obsolete as of Emacs 31.1. `gensym` has been available since Emacs 26.1, below the package minimum of 28.2, so the replacement does not raise the minimum required version.
`if-let` and `when-let` are obsolete as of Emacs 31.1. The starred variants `if-let*`/`when-let*` have been available since Emacs 26.1, below the package minimum of 28.2, and behave identically for these binding forms.
Rename unused function and lambda parameters to use a leading underscore so the byte-compiler no longer warns about unused lexical arguments. Behaviour is unchanged.
Add a GitHub Actions workflow that byte-compiles and loads every source file on Emacs 28.2 (the package minimum), 30.1, and snapshot. Package dependencies are installed from MELPA. The workflow does not use -Werror because several residual warnings come from optional, external integrations (flycheck, polymode, lsp-mode, eglot).
Author
|
This is an automated effort to help maintaining packages in the Emacs community. See https://x.com/dwillems42/status/2060720730338185699 and https://dannywillems.github.io/emacs-package-maintenance/ |
Member
|
We already compiling the source with |
Author
|
It seems that warnings are ignored: https://github.com/emacs-rustic/rustic/actions/runs/24094434046/job/70289119000#step:8:107. |
7a1991c to
fbf3d5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes byte-compiler warnings in the rustic source files. Each
warning type is addressed in its own commit, and only behaviour-preserving
changes were made. Warnings whose fix would change behaviour are left as-is.
The package minimum is Emacs 28.2, so the obsolescence fixes use
replacements available at or below that version (
gensym,if-let*,when-let*, all available since Emacs 26.1).Fixed warnings (behaviour-preserving)
rustic.el,rustic-babel.el,rustic-cargo.el,rustic-clippy.el,rustic-compile.el,rustic-lsp.el,rustic-flycheck.el.literal leading single quotes in
rustic-cargo.elandrustic-interaction.elusing\='.cl-gensymis obsolete (31.1): replaced withgensym(availablesince 26.1) in
rustic.el.if-let/when-letare obsolete (31.1): replaced withif-let*/when-let*(available since 26.1) inrustic-babel.el,rustic-cargo.el,rustic-doc.el,rustic-rustfmt.el.lambda parameters in
rustic-cargo.elandrustic-clippy.el.CI
Adds a
byte-compile.ymlworkflow that byte-compiles and loads everysource file on Emacs 28.2 (the package minimum), 30.1, and snapshot, with
dependencies installed from MELPA. It does not use
-Werrorbecause theresidual warnings below come from optional, external integrations.
Residual warnings (left intentionally)
These would require behaviour changes or depend on optional/external
packages, so they are not addressed here:
replace-buffer-contents->replace-region-contents(behaviour change;rustic-rustfmt.el).project-roots->project-root(behaviour change;rustic-rustfmt.el).defcustomforrustic-popup-commands:listwithout arguments(
:typewidget change;rustic-popup.el).f-exists?is unused (rustic-doc.el): removing itwould change behaviour.
(
rust-*save hooks,result,command,eglot,flymake--diagnostics-buffer-source,flycheck-error-list-buffer,poly-*,rustic-compilation-workspace).(
inheritenv-apply,define-polymode/define-innermode/define-hostmode,lsp-*,eglot-*,flycheck-*,flymake-*,jsonrpc-request,-semver-*,rustic-cargo-binforward reference).global/dynamic var 'eglot' lacks a prefix(external dynamic var).