mcandre / toys

code demos for newbies
https://github.com/mcandre/toys
30 stars 6 forks source link

warn on comments lacking a single space before non-blank content #399

Open mcandre opened 1 year ago

mcandre commented 1 year ago

Code comments like #abc (shell, make), //abc (Java), ///abc / //!abc (Rust) are easier to read when a space separates the comment marker from the content:

# abc

// abc

/// abc

//! abc

That is, the author and the text editor should be prepared to toggle comments by automatically inserting (code -> comment) and automatically removing (comment -> code).

And for docstring multiline comments:

/**
 * abc
 */

Skip applying this style to shebangs.