Skip to content

Conversation

@joshbax189
Copy link
Contributor

Ported lint tests from #275 and fixed some commands.

Most changes to commands follow the same pattern

  • check logs buffer for warnings
  • if there are warnings and --strict is set, exit with code 1
  • in some cases we need to ensure exit with code 1 when errors are present too

There were two other bugs I found

  • lint regexps causes a failure because the reporting format had changed (seems to have changed to an array and with severity in a different position)
  • lint indent always prints Don't call this! as a result of trying to load -pkg.el files. As far as I can tell it doesn't need to install any package dependencies or load package files as it simply reformats the file without interpreting it. I removed this loading step.

@jcs090218
Copy link
Member

lint indent always prints Don't call this! as a result of trying to load -pkg.el files.

This behavior is intentional. In most cases, users do not want the autoloads file to be linted. Only the files specified in the Eask file should be included in linting.

As far as I can tell it doesn't need to install any package dependencies or load package files as it simply reformats the file without interpreting it. I removed this loading step.

No, elisp doesn't know how to do the indentation until some operations are introduced. e.g., like macros.

For example, the indent-lint result from openai.el:

`openai.el` with indent-lint
No mismatch indentation found

`openai-audio.el` with indent-lint
openai-audio.el:60: Expected indentation is 18 but found 4
openai-audio.el:60: Expected indentation is 18 but found 4
openai-audio.el:61: Expected indentation is 18 but found 4
openai-audio.el:61: Expected indentation is 18 but found 4
openai-audio.el:62: Expected indentation is 18 but found 4
...

After loading macros:

`openai.el` with indent-lint
No mismatch indentation found

`openai-audio.el` with indent-lint
No mismatch indentation found

`openai-autoloads.el` with indent-lint
No mismatch indentation found

`openai-chat.el` with indent-lint
No mismatch indentation found

`openai-completion.el` with indent-lint
No mismatch indentation found

`openai-edit.el` with indent-lint
No mismatch indentation found

`openai-embedding.el` with indent-lint
No mismatch indentation found

`openai-engine.el` with indent-lint
No mismatch indentation found

`openai-file.el` with indent-lint
No mismatch indentation found

`openai-fine-tune.el` with indent-lint
No mismatch indentation found

`openai-image.el` with indent-lint
No mismatch indentation found

`openai-model.el` with indent-lint
No mismatch indentation found

`openai-moderation.el` with indent-lint
No mismatch indentation found

(Total of 13 files linted)

@jcs090218
Copy link
Member

I've introduced two new variables eask--has-error-p and eask--has-warn-p in 57e7ae9 so we no longer need variables for each lint commands. :)

The only concern is that this can't differentiate between linting errors and errors from other operations. 🤔 But I don't think we would need to care about this since we only use it to report 'failure.

@jcs090218 jcs090218 added the bug Something isn't working label Nov 14, 2025
@jcs090218
Copy link
Member

I'll merge this now, as it mostly looks good. :D

@jcs090218 jcs090218 merged commit b23841d into emacs-eask:master Nov 14, 2025
174 of 176 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants