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

Proposed convention: exclude files matching *_asm.py from linting in VS Code automatically #221

Open
cpwood opened this issue Feb 4, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cpwood
Copy link

cpwood commented Feb 4, 2021

Is your feature request related to a problem? Please describe.
When writing code in assembler such as the following:

@rp2.asm_pio()
def irq_test():
    wrap_target()
    nop()          [31]
    nop()          [31]
    nop()          [31]
    nop()          [31]
    irq(0)
    nop()          [31]
    nop()          [31]
    nop()          [31]
    nop()          [31]
    irq(1)
    wrap()

this makes linting go crazy as it's obviously not "normal" Python code, despite being accepted happily by MicroPython.

Describe the solution you'd like
I have moved such functions into their own file (e.g. foo_asm.py) and have then added the following to settings.json in VS Code:

    "python.linting.ignorePatterns": [
        ".vscode/*.py",
        "**/*_asm.py"
    ]

This makes pylint a lot quieter!

I'm proposing that this approach is adopted as a convention and that the above JSON is included in the settings.json file created by micropy-cli when initialising a new project.

Describe alternatives you've considered
It's also possible to exclude files using a comment:

# pylint: skip-file

and it's possible to just disable linting for an assembly method:

# pylint: disable=E,W,C,R

however, both approaches require you to add the comments in explicitly, remember the syntax (or find somewhere to copy and paste it from) and requires knowledge of pylint's workings. A standardised file-naming convention supported by micropy-cli would remove those obstacles.

@cpwood cpwood added the enhancement New feature or request label Feb 4, 2021
@BradenM BradenM added the help wanted Extra attention is needed label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants