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

Closed
github-actions bot opened this issue Sep 6, 2024 · 3 comments
Closed

Call for testing ruff #55

github-actions bot opened this issue Sep 6, 2024 · 3 comments
Labels

Comments

@github-actions
Copy link

github-actions bot commented Sep 6, 2024

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

CPU ArchitectureRevision
amd641121
arm641125
armhf1124
ppc64el1123
s390x1122

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 1121,1125,1124,1123,1122 latest/stable done
Copy link
Author

github-actions bot commented Sep 6, 2024

Automated testing success.

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

Logs
ruff 0.6.3 (ee258caed 2024-08-29)
::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/10730272670)

 = 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

mypyc/test/test_analysis.py:75:29: UP031 Use format specifiers instead of percent format
|
73 | post = ", ".join(sorted(names[reg] for reg in analysis_result.after[key]))
74 | actual.append(
75 | "%-8s %-23s %s" % ((key[0].label, key[1]), "{{{}}}".format(pre), "{{{}}}".format(post))
| ^^^^^^^^^^^^^^^ UP031
76 | )
77 | assert_test_output(testcase, actual, "Invalid source code output")
|
= help: Replace with format specifiers

mypyc/test/test_run.py:324:19: UP031 Use format specifiers instead of percent format
|
322 | if proc.returncode != 0:
323 | print()
324 | print("*** Exit status: %d" % proc.returncode)
| ^^^^^^^^^^^^^^^^^^^^^ UP031
325 |
326 | # Verify output.
|
= help: Replace with format specifiers

mypyc/test/test_run.py:422:44: UP031 Use format specifiers instead of percent format
|
420 | fnam = os.path.basename(fnam)
421 | message = re.sub(
422 | r"native.py:([0-9]+):", lambda m: "%s:%d:" % (fnam, int(m.group(1)) + delta), message
| ^^^^^^^^ UP031
423 | )
424 | message = re.sub(
|
= help: Replace with format specifiers

mypyc/test/test_run.py:426:19: UP031 Use format specifiers instead of percent format
|
424 | message = re.sub(
425 | r'"native.py", line ([0-9]+),',
426 | lambda m: '"%s", line %d,' % (fnam, int(m.group(1)) + delta),
| ^^^^^^^^^^^^^^^^ UP031
427 | message,
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-g9YGErKA'...
All checks passed!
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).
1231 files left unchanged
184 files reformatted, 1047 files left unchanged
::endgroup::


</details>

@lengau
Copy link
Contributor

lengau commented Sep 6, 2024

/promote 1121,1125,1124,1123,1122 latest/stable done

Copy link
Author

github-actions bot commented Sep 6, 2024

The following revisions were released to the latest/stable channel: 1121,1125,1124,1123,1122.

@github-actions github-actions bot closed this as completed Sep 6, 2024
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