wakatime-mode icon indicating copy to clipboard operation
wakatime-mode copied to clipboard

Address linting errors and restore support for Emacs <28

Open kisaragi-hiu opened this issue 2 months ago • 0 comments

20240410T015614+0900

The errors in question

Each commit in this PR fixes a class of issues. This PR also turns on lexical-binding. Ths issues are:

  • 7d9054e1657fc27d6652ccd4fc7f28fa8a218d87 string-replace was added in Emacs 28, so up until now this package only worked on Emacs 28 or above. This could be fixed by:

    • depending on compat.el (new feature polyfills for old Emacs versions)
    • declaring Emacs 28 as a requirement
    • or using s-replace from s.el.

    I chose to depend on s.el because (a) it's on MELPA as well, (b) this package was already copying s-blank? inline (as s-blank, with the wrong package prefix), and (c) there is no need to drop Emacs pre-28 here.

    I replaced the s-blank function previously defined by this package with s-blank? from s.el, and string-replace with s-replace.

  • c3ecb78408fcf346fa00e72fa973a045bce47ca3 Package should have a Homepage or URL header. Previously this package was using a nonstandard "Website" header.

  • 8bd143ea208eb9ad0bf8885a58fb0c18f27af037 2b25d092fa39b538467e54b3d7af201d43e660b6 Docstrings should:

    • include all arguments
    • have a first line that is a complete sentence less than 80 characters long
    • not have indentation for normal paragraphs (they would make it into the docstring, not be trimmed like in Python, and end up looking weird in *Help* pages)

    Moreover, there is a strong nudge to add docstrings to all functions and variables. There was just one function without a docstring, so I wrote one for it.

The parentheses and indentation style should also be updated to be more conventional for Emacs Lisp, to make it less painful to edit without introducing lots of style noise. That is not in scope of this PR though, to make this PR easier to review.

kisaragi-hiu avatar Apr 09 '24 17:04 kisaragi-hiu