Add initial configuration for ESLint (fix Codacy issues) - #7096
Conversation
Up to standards ✅🟢 Issues
|
|
It looks like this PR has not the desired effect on Codacy. Therefore I marked it as draft now |
|
Related documentation: |
|
According to the Codacy documentation, configuration files are always read from the default branch. So the change here has no effect until it was merged into the main branch. I suggest to do this, then we will see whether it works. |
henning-gerhardt
left a comment
There was a problem hiding this comment.
I can not review this as
- I did not have access to nor I'm using Codacy
- I did not know how Codacy is set up for Kitodo.Production and so I don't know is this change is really working or did anything
- I'm not familiar with ESLint and did not find any documentation of all this used configuration parameters
- ESLint is using be default a different configuration file naming
https://app.codacy.com/gh/kitodo/kitodo-production/issues/current does not work for you?
The Codacy Static Code Analysis is part of the checks which run for each pull request here. |
Which one? Please compare this documention. |
Then you should first merge it into the |
|
I now managed to add Codacy to my personal fork. With an updated version of .eslintrc.json, the warnings for undefined So the new file works, but we have to decide which kinds of issues should be reported or not reported by Codacy / ESLint. It is possible to add exclude_paths in a new file .codacy.yml for generated code, test directories, and minified JS that shouldn't be linted. Of course it would also be possible to remove the Codacy app in the settings of kitodo/kitodo-production. Then it would no longer check pull requests or report issues. I don't suggest this. |
Codacy uses ESLint. Tell it that certain variables like `PF` are defined. This avoids related issue reports about undefined variables. Assisted-by: qwen3.6-36b (Alibaba) Signed-off-by: Stefan Weil <sw@weilnetz.de>
Assisted-by: Claude Sonnet 4.6 (Anthropic) Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
@stweil I agree that we should not deactivate Codacy entirely. I like the idea of excluding certain paths from the check. Perhaps the results also be restricted by severity? |
|
Sure, fine tuning might be possible (I'd have to look it up in the documention to see what is possible). I suggest to merge this PR here. Then we will see what gets reported in the future, and we can decide which kind of issues we want to ignore. Filtering purely on the severity would in my opinion not be sufficient. For example bad style would not be a high severity, but we want to avoid it nevertheless. |
| "PrimeFaces": "readonly", | ||
| "jsf": "readonly", | ||
| "faces": "readonly", | ||
| "mojarra": "readonly" |
There was a problem hiding this comment.
We don't use Mojarra as JSF implementation, but rather MyFaces, so why do we need to define "mojarra" as a global here? Does it occur somewhere in the code?
| "mojarra": "readonly" | ||
| }, | ||
| "rules": { | ||
| "no-undef": "error" |
There was a problem hiding this comment.
We have to keep an eye on this, because there may be other false positives apart from "PF" etc. when marking supposedly undefined symbols.
Codacy uses ESLint. Tell it that certain variables like
PFare defined. This avoids related issue reports about undefined variables.