Conversation
|
We're already using |
|
We're using semantic-release for (Our own |
apotterri
left a comment
There was a problem hiding this comment.
Thanks very much for this.
appmap/unittest.py
Outdated
|
|
||
| if not Env.current.is_appmap_repo and Env.current.enables("unittest"): | ||
| logger.debug("Test recording is enabled (unittest)") | ||
| import _appmap.unittest # pyright: ignore pylint: disable=unused-import |
There was a problem hiding this comment.
This import needs to be retained, so it should be marked with # noqa: F401 rather than deleted.
pyproject.toml
Outdated
| # | ||
| # So, if you'd like to run the tests outside of tox, run `pip install -r requirements-dev.txt` to | ||
| # install it and the rest of the dev dependencies. | ||
| ruff = "^0.3.3" |
There was a problem hiding this comment.
This should be in the dev dependencies (below).
Updated the commit message. Hopefully chose the correct one. |
Most of projects are now moving from pylint to ruff. Also, the fastapi unused wsgimiddleware import, ruff highlighted it, but I didn't notice it as such in the pylint output. This was a suggestion for replacing pylint with ruff and not both together. I am not aware of other places where you might have to replace pylint in the dev environments/ CI etc. |
We need to retain this functionality if we switch to ruff, so this PR would need to include changes to do that, as well. |
|
@apotterri Just to confirm, this is executed when running tox? Also, what is the expected outcome here? Tests should fail if there is any pylint error? As pylint-exit only returns 1 on |
|
Yes, it's run when the pylint computes a score for the code, and has a setting that controls the minimum score: https://github.com/getappmap/appmap-python/blob/master/pylintrc#L3 . If the code that's getting built has a score that's below that threshold, pylint-exit returns non-zero. |
Doesn't seem to be working that way. |
|
That would be bug, then. It's intended to work that way, and I thought that was the description from pylint-exit. |
Looking again at the doc for pylint-exit, I see that I misread it. It doesn't clean to exit non-zero if the |
|
As far as replacing pylint with ruff.... I'm concerned about the statement here that ruff isn't a drop-in replacement for pylint: https://docs.astral.sh/ruff/faq/#how-does-ruffs-linter-compare-to-pylint , and especially that it does less type checking. Also astral-sh/ruff#970 . |
|
Yes, ruff is used along with mypy. But at this time, adding type annotation for every variable might be a big task. We can leave adding ruff in backlog as a future task, but address the highlighted issues in a separate PR. |
|
So just to understand how to move this along is by adding mypy as a separate PR that does the type checking? And if this is implemented in a separate PR than this could move forward? |
poetry run ruff check --fix appmaphttps://docs.astral.sh/ruff/