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 #73

Open
github-actions bot opened this issue Dec 20, 2024 · 1 comment
Open

Call for testing ruff #73

github-actions bot opened this issue Dec 20, 2024 · 1 comment
Labels

Comments

@github-actions
Copy link

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

CPU ArchitectureRevision
amd641208
arm641210
armhf1209
ppc64el1212
s390x1211

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 1208,1210,1209,1212,1211 latest/stable done
Copy link
Author

Automated testing success.

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

Logs
ruff 0.8.4 (3bb0dac23 2024-12-19)
::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
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
analyze  Run analysis over Python source code
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")

airflow-dag-no-schedule-argument (AIR301)

Derived from the Airflow linter.

This rule is in preview and is not stable. The --preview flag is required for use.

What it does

Checks for a DAG() class or @dag() decorator without an explicit
schedule parameter.

Why is this bad?

The default schedule value on Airflow 2 is timedelta(days=1), which is
almost never what a user is looking for. Airflow 3 changes this the default
to None, and would break existing DAGs using the implicit default.

If your DAG does not have an explicit schedule argument, Airflow 2
schedules a run for it every day (at the time determined by start_date).
Such a DAG will no longer be scheduled on Airflow 3 at all, without any
exceptions or other messages visible to the user.

Example

from airflow import DAG


# Using the implicit default schedule.
dag = DAG(dag_id="my_dag")

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

419 | sig = builder.mapper.fdef_to_sig(fdef, builder.options.strict_dunders_typing)
420 | func_ir, func_reg = gen_func_item(builder, fdef, name, sig, cdef)
| ^^^^^^^^ F841
421 | builder.functions.append(func_ir)
|
= help: Remove assignment to unused variable func_reg

mypyc/irbuild/function.py:964:29: F841 Local variable fn_info is assigned to but never used
|
962 | ret_val = builder.builder.call(callable_class_decl, args, arg_kinds, arg_names, line)
963 | builder.add(Return(ret_val))
964 | arg_regs, _, blocks, _, fn_info = builder.leave()
| ^^^^^^^ F841
965 | return FuncIR(decl, arg_regs, blocks)
|
= help: Remove assignment to unused variable fn_info

mypyc/irbuild/function.py:1072:22: F841 Local variable ret_type is assigned to but never used
|
1070 | else:
1071 | builder.add(Unreachable())
1072 | args, _, blocks, ret_type, fn_info = builder.leave()
| ^^^^^^^^ F841
1073 | return FuncIR(func_decl, args, blocks)
|
= help: Remove assignment to unused variable ret_type

mypyc/irbuild/function.py:1072:32: F841 Local variable fn_info is assigned to but never used
|
1070 | else:
1071 | builder.add(Unreachable())
1072 | args, _, blocks, ret_type, fn_info = builder.leave()
| ^^^^^^^ F841
1073 | return FuncIR(func_decl, args, blocks)
|
= help: Remove assignment to unused variable fn_info

mypyc/irbuild/function.py:1092:22: F841 Local variable ret_type is assigned to but never used
|
1090 | builder.add(SetAttr(self_reg, attr_name, value_reg, -1))
1091 | builder.add(Return(builder.none()))
1092 | args, _, blocks, ret_type, fn_info = builder.leave()
| ^^^^^^^^ F841
1093 | return FuncIR(func_decl, args, blocks)
|
= help: Remove assignment to unused variable ret_type

mypyc/irbuild/function.py:1092:32: F841 Local variable fn_info is assigned to but never used
|
1090 | builder.add(SetAttr(self_reg, attr_name, value_reg, -1))
1091 | builder.add(Return(builder.none()))
1092 | args, _, blocks, ret_type, fn_info = builder.leave()
| ^^^^^^^ F841
1093 | return FuncIR(func_decl, args, blocks)
|
= help: Remove assignment to unused variable fn_info

mypyc/irbuild/main.py:146:22: F841 Local variable ret_type is assigned to but never used
|
145 | # Generate special function representing module top level.
146 | args, _, blocks, ret_type, _ = builder.leave()
| ^^^^^^^^ F841
147 | sig = FuncSignature([], none_rprimitive)
148 | func_ir = FuncIR(
|
= help: Remove assignment to unused variable ret_type

Found 32 errors (2 fixed, 30 remaining).
warning: The following rule may cause conflicts when used with the formatter: ISC001. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the select or extend-select configuration, or adding it to the ignore configuration.
8 files reformatted, 304 files left unchanged
warning: The following rule may cause conflicts when used with the formatter: ISC001. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the select or extend-select configuration, or adding it to the ignore configuration.
51 files reformatted, 261 files left unchanged
::endgroup::

::group::Repository: https://github.com/tiangolo/fastapi
Cloning into 'ruff-snap-test-38FxlL5t'...
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()``

Found 1 error.
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()``

Found 4 errors (3 fixed, 1 remaining).
1283 files left unchanged
197 files reformatted, 1086 files left unchanged
::endgroup::


</details>

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

0 participants