Skip to content
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

Fix flycheck-error-level-interesting-p #1870

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KevOrr
Copy link

@KevOrr KevOrr commented Mar 29, 2021

According to its docstring, flycheck-error-level-interesting-p should return true if there are no errors as or more severe than flycheck-navigation-minimum-level. Currently, however, it only checks if there are any errors exactly as severe as flycheck-navigation-minimum-level (via flycheck-has-current-errors-p). This patch:

  • improves the documentation of
    • flycheck-has-current-errors-p
    • flycheck-has-errors-p
  • introduces two new functions
    • flycheck-has-current-errors-atleast-p
    • flycheck-has-errors-atleast-p
  • Changes flycheck-error-level-interesting-p to use flycheck-has-current-errors-atleast-p, instead of its "exact" sibling, bringing its actual behavior in line with its documented behavior

I also considered changing flycheck-has-[current-]errors-p to use >= instead of eq, but since it has a public name (I'm assuming -- is used to signal that a symbol is private), I didn't want to introduce a backwards-breaking change. If instead it should be the case that flycheck-has-[current-]errors-p check for errors at least as severe as level, then I can edit this PR to modify them directly.

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2021

CLA assistant check
All committers have signed the CLA.

According to its docstring, `flycheck-error-level-interesting-p` should
return true if there are no errors as _or more severe than_
`flycheck-navigation-minimum-level`. Currently, however, it only checks
if there are any errors exactly as severe as
`flycheck-navigation-minimum-level` (via
`flycheck-has-current-errors-p`). This patch:

* improves the documentation of
  * `flycheck-has-current-errors-p`
  * `flycheck-has-errors-p`
* introduces two new functions
  * `flycheck-has-current-errors-atleast-p`
  * `flycheck-has-errors-atleast-p`
* Changes `flycheck-error-level-interesting-p` to use
  `flycheck-has-current-errors-atleast-p`, instead of its "exact"
  sibling, bringing its actual behavior in line with its documented
  behavior
@KevOrr KevOrr force-pushed the fix-flycheck-next-error-interesting branch from 536a229 to c312490 Compare March 29, 2021 19:55
@KevOrr
Copy link
Author

KevOrr commented Mar 29, 2021

Oops, I should have run the tests locally before submitting this PR. It seems as though some of the tests rely on the old behavior of flycheck-error-level-interesting-p. For example flycheck-first-error/over-warnings/goes-to-first-error assumes that by setting flycheck-navigation-minimum-level to 'warning, then (flycheck-first-error) will move onto the checkdoc error of level 'info on line 12 of errors-and-warnings.el. Should the checkdoc error indeed be of level 'info or is this a local configuration thing, and it should be 'warning or higher?

@bbatsov
Copy link
Contributor

bbatsov commented Feb 5, 2024

Seems like a duplicate of #1994. We should agree which approach to solving the issue is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants