ruff/crates/flake8_to_ruff
konstin 73e179ffab
Update maturin to 1.0 (#4605)
* Refactor and fix task trigger for dependent jobs in other repos

I have confirmed (9075029868) that this does dispatch the workflow when running with act, `owner: 'konstin'`, `needs` commented out and personal access token. I can't properly test the actual release workflow, and i'm unsure how to best handle the next release after this was merged (should we do a beta release or will this break everything that assumes we only do stable releases?)

The command for act is
```
act -j update-dependents -s RUFF_PRE_COMMIT_PAT=<...>
```

* delete old file

* Update maturin to 1.0

A 1.0 release for maturin 🎉
2023-05-23 20:55:52 +02:00
..
examples refactor: Introduce crates folder (#2088) 2023-02-05 16:47:48 -05:00
src Infer target-version from project metadata (#3470) 2023-03-13 18:16:01 +01:00
Cargo.toml Bump version to 0.0.269 (#4506) 2023-05-18 19:45:20 +00:00
pyproject.toml Update maturin to 1.0 (#4605) 2023-05-23 20:55:52 +02:00
README.md Change broken links in README to beta.ruff.rs (#3607) 2023-03-19 15:17:44 +00:00

flake8-to-ruff

Convert existing Flake8 configuration files (setup.cfg, tox.ini, or .flake8) for use with Ruff.

Generates a Ruff-compatible pyproject.toml section.

Installation and Usage

Installation

Available as flake8-to-ruff on PyPI:

pip install flake8-to-ruff

Usage

To run flake8-to-ruff:

flake8-to-ruff path/to/setup.cfg
flake8-to-ruff path/to/tox.ini
flake8-to-ruff path/to/.flake8

flake8-to-ruff will print the relevant pyproject.toml sections to standard output, like so:

[tool.ruff]
exclude = [
    '.svn',
    'CVS',
    '.bzr',
    '.hg',
    '.git',
    '__pycache__',
    '.tox',
    '.idea',
    '.mypy_cache',
    '.venv',
    'node_modules',
    '_state_machine.py',
    'test_fstring.py',
    'bad_coding2.py',
    'badsyntax_*.py',
]
select = [
    'A',
    'E',
    'F',
    'Q',
]
ignore = []

[tool.ruff.flake8-quotes]
inline-quotes = 'single'

[tool.ruff.pep8-naming]
ignore-names = [
    'foo',
    'bar',
]

Plugins

flake8-to-ruff will attempt to infer any activated plugins based on the settings provided in your configuration file.

For example, if your .flake8 file includes a docstring-convention property, flake8-to-ruff will enable the appropriate flake8-docstrings checks.

Alternatively, you can manually specify plugins on the command-line:

flake8-to-ruff path/to/.flake8 --plugin flake8-builtins --plugin flake8-quotes

Limitations

  1. Ruff only supports a subset of the Flake configuration options. flake8-to-ruff will warn on and ignore unsupported options in the .flake8 file (or equivalent). (Similarly, Ruff has a few configuration options that don't exist in Flake8.)
  2. Ruff will omit any rule codes that are unimplemented or unsupported by Ruff, including rule codes from unsupported plugins. (See the documentation for the complete list of supported plugins.)

License

MIT

Contributing

Contributions are welcome and hugely appreciated. To get started, check out the contributing guidelines.