-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
r.topidx: Rewrite Perl scripts in Python 3 #766
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That's a (very!) good solution of #762. I think I lack context to fully review this. (Documentation, tests, ... I'm not saying you need to add them to get this merged since the goal is just to get #762 resolved and for that the current extent of the PR is more than enough.)
As for general Python, just apply Black and then use Flake8 with default settings. From other things, I see only f-strings, but I think we can already allow them in "secondary" code like this (so just leave those there).
|
On a second thought, f-strings are probably okay for these scripts, just applying Black and checking the code with Flake8 should be enough. |
|
@HuidaeCho do you plan to make further modifications? |
@neteler No, I think this is it. I'm not familiar with Black and Flake8. |
|
flake8 reports this: I'll fix it here. |
|
Do you want any other changes @wenzeslaus (since the PR is still in "changes requested" mode)? |
I was suggesting only to use Flake8 and Black which seems you did to at least some extent. Fully applying Black would be good. |
|
(Please (someone) add the magic black cmd line to |
See Style > Automation at https://trac.osgeo.org/grass/wiki/Submitting/Python#Automation |
Co-authored-by: Markus Neteler <neteler@gmail.com>
|
I suggest to merge. The |
@neteler Agreed with you. The |
|
Since I'm introducing Black elsewhere (#1347) and we have already used some Black here and there, I have applied Black and renamed files to use underscores instead of dots to separate words. Example of what I consider an improvement: - if len(sys.argv) == 1 or len(sys.argv) == 4 or len(sys.argv) > 5 or \
- re.match('^-*help', sys.argv[1]):
- print('Usage: gridatb.to.arc.py gridatb_file arc_file'
- ' [xllcorner yllcorner]')
+ if (
+ len(sys.argv) == 1
+ or len(sys.argv) == 4
+ or len(sys.argv) > 5
+ or re.match("^-*help", sys.argv[1])
+ ):
+ print("Usage: gridatb.to.arc.py gridatb_file arc_file [xllcorner yllcorner]")The |
|
+1 for merging it whenever it's ready. I don't worry too much about how the code looks. |
This enables Perl in Super-Linter check since local perlcritic does not give any errors after OSGeo#766 and OSGeo#1431.
This enables Perl in Super-Linter check (uses plain perl) since local perlcritic does not give any errors after OSGeo#766 and OSGeo#1431.
This enables Perl in Super-Linter check (uses plain perl) since local perlcritic does not give any errors after OSGeo#766 and OSGeo#1431.
Address #762.