ruff/scripts
Javier Kauer 1e07bfa373
[pycodestyle] Whitespace after decorator (E204) (#12140)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
This is the implementation for the new rule of `pycodestyle (E204)`. It
follows the guidlines described in the contributing site, and as such it
has a new file named `whitespace_after_decorator.rs`, a new test file
called `E204.py`, and as such invokes the `function` in the `AST
statement checker` for functions and functions in classes. Linking #2402
because it has all the pycodestyle rules.

## Test Plan

<!-- How was it tested? -->
The file E204.py, has a `decorator` defined called wrapper, and this
decorator is used for 2 cases. The first one is when a `function` which
has a `decorator` is called in the file, and the second one is when
there is a `class` and 2 `methods` are defined for the `class` with a
`decorator` attached it.

Test file:

``` python
def foo(fun):
    def wrapper():
        print('before')
        fun()
        print('after')
    return wrapper

# No error
@foo
def bar():
    print('bar')

# E204
@ foo
def baz():
    print('baz')

class Test:
    # No error
    @foo
    def bar(self):
        print('bar')

    # E204
    @ foo
    def baz(self):
        print('baz')
```

I am still new to rust and any suggestion is appreciated. Specially with
the way im using native ruff utilities.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-07-04 23:31:03 +00:00
..
benchmarks Release v0.5.0 (#12068) 2024-06-27 14:46:44 +00:00
fuzz-parser Remove use of deprecated E999 from the fuzz-parser script (#12150) 2024-07-02 14:18:25 +01:00
release Update release script to match uv (#11496) 2024-07-03 07:35:28 -05:00
_mdformat_utils.py Add a formatting step using mdformat as part of generate_mkdocs.py (#10484) 2024-03-21 00:37:40 +00:00
_utils.py Use __future__ imports in scripts (#5301) 2023-06-22 11:40:16 -04:00
add_plugin.py Update pre-commit dependencies (#11195) 2024-04-29 08:40:21 +00:00
add_rule.py fixes invalid rule from hyphen (#11484) 2024-05-21 23:39:50 -04:00
check_docs_formatted.py [pycodestyle] Whitespace after decorator (E204) (#12140) 2024-07-04 23:31:03 +00:00
check_ecosystem.py Remove demisto/content from ecosystem checks (#12129) 2024-07-01 12:20:13 +00:00
Dockerfile.ecosystem Remove outdated feature flag from Dockerfile.ecosystem (#4620) 2023-05-24 08:19:08 +00:00
ecosystem_all_check.py Update pre-commit dependencies (#10698) 2024-04-06 23:00:41 +00:00
ecosystem_all_check.sh Rename Autofix to Fix (#7657) 2023-09-28 10:53:05 +00:00
ecosystem_all_check_entrypoint.sh Make ecosystem all check more generic (#4629) 2023-05-24 16:26:23 +02:00
formatter_ecosystem_checks.sh Fix the ecosystem check (#10155) 2024-02-28 17:42:06 +00:00
generate_known_standard_library.py Add Python 3.13 to list of allowed Python versions (#11411) 2024-05-13 16:35:41 +00:00
generate_mkdocs.py Update pre-commit dependencies (#10698) 2024-04-06 23:00:41 +00:00
pyproject.toml Improve the update_schemastore script (#11353) 2024-05-13 17:06:54 +00:00
release.sh Update release script to match uv (#11496) 2024-07-03 07:35:28 -05:00
transform_readme.py Update pre-commit dependencies (#10698) 2024-04-06 23:00:41 +00:00
update_ambiguous_characters.py Update pre-commit dependencies (#10698) 2024-04-06 23:00:41 +00:00
update_schemastore.py Use https by default in schema store update script (#11882) 2024-06-14 17:30:54 -05:00