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

Call for testing ruff #53

Closed
github-actions bot opened this issue Aug 16, 2024 · 3 comments
Closed

Call for testing ruff #53

github-actions bot opened this issue Aug 16, 2024 · 3 comments
Labels

Comments

@github-actions
Copy link

A new version (0.6.1) of ruff was just pushed to the latest/candidate channel in the snap store. The following revisions are available.

CPU ArchitectureRevision
amd641111
arm641114
armhf1115
ppc64el1113
s390x1112

Automated testing

If configured, the snap will be installed in a VM, and any test results or screenshots will be posted to this issue as a comment shortly.

How to test it manually

  1. Stop the application if it was already running
  2. Upgrade to this version by running
snap refresh ruff --channel latest/candidate
  1. Start the app and test it out.
  2. Finally, add a comment below explaining whether this app is working, and include the output of the following command.
snap version; lscpu | grep Architecture; snap info ruff | grep installed

How to release it

Maintainers can promote this to stable by commenting /promote <rev>[,<rev>] latest/stable [done].

For example

  • To promote a single revision, run /promote <rev> latest/stable
  • To promote multiple revisions, run /promote <rev>,<rev> latest/stable
  • To promote a revision and close the issue, run /promote <rev>,<rev> latest/stable done

You can promote all revisions that were just built with:

/promote 1111,1114,1115,1113,1112 latest/stable done
Copy link
Author

Automated testing success.

Full logs are available at https://github.com/snapcrafters/ruff/actions/runs/10424701636. The first 100, and last 100 lines of the log are displayed in the Summary below.

Logs
ruff 0.6.1 (499c0bd87 2024-08-16)
::endgroup::
::group::Help
Ruff: An extremely fast Python linter and code formatter.

Usage: ruff [OPTIONS] <COMMAND>

Commands:
check    Run Ruff on the given files or directories (default)
rule     Explain a rule (or all rules)
config   List or describe the available configuration options
linter   List all supported upstream linters
clean    Clear any caches in the current directory and any subdirectories
format   Run the Ruff formatter on the given files or directories
server   Run the language server
version  Display Ruff's version
help     Print this message or the help of the given subcommand(s)

Options:
-h, --help     Print help
-V, --version  Print version

Log levels:
-v, --verbose  Enable verbose logging
-q, --quiet    Print diagnostics, but nothing else
-s, --silent   Disable all logging (but still exit with status code "1" upon detecting
               diagnostics)

Global options:
    --config <CONFIG_OPTION>  Either a path to a TOML configuration file (`pyproject.toml` or
                              `ruff.toml`), or a TOML `<KEY> = <VALUE>` pair (such as you might
                              find in a `ruff.toml` configuration file) overriding a specific
                              configuration option. Overrides of individual settings using this
                              option always take precedence over all configuration files,
                              including configuration files that were also specified using
                              `--config`
    --isolated                Ignore all configuration files

For help with a specific command, see: `ruff help <command>`.
::endgroup::
::group::Rules:
# airflow-variable-name-task-id-mismatch (AIR001)

Derived from the **Airflow** linter.

## What it does
Checks that the task variable name matches the `task_id` value for
Airflow Operators.

## Why is this bad?
When initializing an Airflow Operator, for consistency, the variable
name should match the `task_id` value. This makes it easier to
follow the flow of the DAG.

## Example
```python
from airflow.operators import PythonOperator


incorrect_name = PythonOperator(task_id="my_task")

Use instead:

from airflow.operators import PythonOperator


my_task = PythonOperator(task_id="my_task")

commented-out-code (ERA001)

Derived from the eradicate linter.

What it does

Checks for commented-out Python code.

Why is this bad?

Commented-out code is dead code, and is often included inadvertently.
It should be removed.

Known problems

Prone to false positives when checking comments that resemble Python code,
but are not actually Python code (#4845).

Example

# print("Hello, world!")

Options

  • lint.task-tags

fast-api-redundant-response-model (FAST001)

Derived from the FastAPI linter.

Fix is always available.

(Logs truncated. See full logs at: https://github.com/snapcrafters/ruff/actions/runs/10424701636)

428 | )
|
= help: Replace with format specifiers

mypyc/test/testutil.py:214:15: UP031 Use format specifiers instead of percent format
|
212 | lines = s.splitlines()
213 | for i, line in enumerate(lines):
214 | print("%-4d %s" % (i + 1, line))
| ^^^^^^^^^ UP031
|
= help: Replace with format specifiers

mypyc/transform/exceptions.py:121:35: UP031 Use format specifiers instead of percent format
|
119 | negated = True
120 | else:
121 | assert False, "unknown error kind %d" % op.error_kind
| ^^^^^^^^^^^^^^^^^^^^^^^ UP031
122 |
123 | # Void ops can't generate errors since error is always
|
= help: Replace with format specifiers

Found 175 errors (84 fixed, 91 remaining).
warning: The following rules may cause conflicts when used with the formatter: ISC001. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the select or extend-select configuration, or adding them to the ignore configuration.
17 files reformatted, 295 files left unchanged
warning: The following rules may cause conflicts when used with the formatter: ISC001. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the select or extend-select configuration, or adding them to the ignore configuration.
40 files reformatted, 272 files left unchanged
::endgroup::

::group::Repository: https://github.com/tiangolo/fastapi
Cloning into 'ruff-snap-test-uvJs9w8v'...
fastapi/routing.py:458:18: UP037 [*] Remove quotes from type annotation
|
456 | if isinstance(generate_unique_id_function, DefaultPlaceholder):
457 | current_generate_unique_id: Callable[
458 | ["APIRoute"], str
| ^^^^^^^^^^ UP037
459 | ] = generate_unique_id_function.value
460 | else:
|
= help: Remove quotes

tests/test_inherited_custom_class.py:39:16: E721 Use is and is not for type comparisons, or isinstance() for isinstance checks
|
37 | asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
38 | assert isinstance(asyncpg_uuid, uuid.UUID)
39 | assert type(asyncpg_uuid) != uuid.UUID
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
40 | with pytest.raises(TypeError):
41 | vars(asyncpg_uuid)
|

tests/test_inherited_custom_class.py:82:16: E721 Use is and is not for type comparisons, or isinstance() for isinstance checks
|
80 | asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
81 | assert isinstance(asyncpg_uuid, uuid.UUID)
82 | assert type(asyncpg_uuid) != uuid.UUID
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
83 | with pytest.raises(TypeError):
84 | vars(asyncpg_uuid)
|

Found 3 errors.
[*] 1 fixable with the --fix option.
docs_src/sql_databases_peewee/sql_app/database.py:7:43: B039 Do not use mutable data structures for ContextVar defaults
|
5 | DATABASE_NAME = "test.db"
6 | db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None}
7 | db_state = ContextVar("db_state", default=db_state_default.copy())
| ^^^^^^^^^^^^^^^^^^^^^^^ B039
|
= help: Replace with None; initialize with `.set()``

tests/test_inherited_custom_class.py:39:16: E721 Use is and is not for type comparisons, or isinstance() for isinstance checks
|
37 | asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
38 | assert isinstance(asyncpg_uuid, uuid.UUID)
39 | assert type(asyncpg_uuid) != uuid.UUID
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
40 | with pytest.raises(TypeError):
41 | vars(asyncpg_uuid)
|

tests/test_inherited_custom_class.py:82:16: E721 Use is and is not for type comparisons, or isinstance() for isinstance checks
|
80 | asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
81 | assert isinstance(asyncpg_uuid, uuid.UUID)
82 | assert type(asyncpg_uuid) != uuid.UUID
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
83 | with pytest.raises(TypeError):
84 | vars(asyncpg_uuid)
|

Found 7 errors (4 fixed, 3 remaining).
5 files reformatted, 1215 files left unchanged
179 files reformatted, 1041 files left unchanged
::endgroup::


</details>

@lengau
Copy link
Contributor

lengau commented Aug 16, 2024

/promote 1111,1114,1115,1113,1112 latest/stable done

Copy link
Author

The following revisions were released to the latest/stable channel: 1111,1114,1115,1113,1112.

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

No branches or pull requests

1 participant