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

fix flake8 errors and add flake8 Github Action #28

Merged
merged 8 commits into from
Mar 27, 2023

Conversation

johanneskastl
Copy link

@johanneskastl johanneskastl commented Mar 15, 2023

Add a GitHub action that lints the go_modules file.

@johanneskastl
Copy link
Author

Only errors left:

go_modules:88:63: W605 invalid escape sequence '\.'
go_modules:88:90: W605 invalid escape sequence '\.'
go_modules:88:94: W605 invalid escape sequence '\.'

All from the big regex:

 87     basename = re.sub(                                                                                                                                                                   
 88         "^(?P<service_prefix>_service:[^:]+:)?(?P<basename>.*)\.(?P<extension>obscpio|tar\.[^\.]+)$",  # noqa: E501                                                                      
 89         r"\g<basename>",                                                                                                                                                                 
 90         archive_name,                                                                                                                                                                    
 91     )

@johanneskastl johanneskastl force-pushed the 20230315_fix_flake8_errors branch from 09a7c25 to 993f18a Compare March 15, 2023 20:10
@johanneskastl
Copy link
Author

Only errors left:

go_modules:88:63: W605 invalid escape sequence '\.'
go_modules:88:90: W605 invalid escape sequence '\.'
go_modules:88:94: W605 invalid escape sequence '\.'

All from the big regex:

 87     basename = re.sub(                                                                                                                                                                   
 88         "^(?P<service_prefix>_service:[^:]+:)?(?P<basename>.*)\.(?P<extension>obscpio|tar\.[^\.]+)$",  # noqa: E501                                                                      
 89         r"\g<basename>",                                                                                                                                                                 
 90         archive_name,                                                                                                                                                                    
 91     )

This can be fixed by prepending a r:

-        "^(?P<service_prefix>_service:[^:]+:)?(?P<basename>.*)\.(?P<extension>obscpio|tar\.[^\.]+)$",  # noqa: E501
+        r"^(?P<service_prefix>_service:[^:]+:)?(?P<basename>.*)\.(?P<extension>obscpio|tar\.[^\.]+)$",  # noqa: E501

@johanneskastl
Copy link
Author

Github Action for flake8 linting is now green :-)
https://github.com/johanneskastl/obs-service-go_modules/actions

@dirkmueller dirkmueller merged commit 07ad8bd into openSUSE:master Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants