You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I should like to have a directive to exclude some part of code from check. I know # ruff: noqa but it applies to the whole file.
I think that can be useful to have a directive to esclude only the code which follow it, It can be used for example for code after a __main__ test to put some print or some assert without any ruff warning:
if __name__ == '__main__':
# ruff-after: noqa
....
I called it # ruff-after but obviously the name can be another one.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I should like to have a directive to exclude some part of code from check. I know
# ruff: noqa
but it applies to the whole file.I think that can be useful to have a directive to esclude only the code which follow it, It can be used for example for code after a
__main__
test to put someprint
or someassert
without any ruff warning:I called it
# ruff-after
but obviously the name can be another one.Beta Was this translation helpful? Give feedback.
All reactions