linting/formatting convention #20
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#20
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It would be nice to perform linting and formatting of stuff when it is submitted. Are there any preferences on this?
I use black to format code, and am looking at pylint for static analysis.
Give it a shot and I'll learn from watching what you set up. This seems worthwhile to me!
Maybe to clarify, there are many approaches to doing this, the three I know about are:
Handling some of this manually for now is a good opportunity to learn, but will also help us understand which lint warnings we don't think are important. To illustrate, here are some examples:
These are preferential - how closely do we want to conform to python naming standards?
This is likely solid advice that needs to be actioned.
Later today I'll look in to this further.
I'm happy to try very hard to conform to standards and pythonic coding practices. I code Python in a wild and unprincipled way, and this is a good opportunity to learn some manners and civilized coding practices.
For now, I'd recommend installing black and pylint and running them over any new changes you make. This is manual, but helps as follows:
At the moment, there are too many issues coming up from pylint as it is unconfigured, so don't feel the need to do everything or anything it says.
Ok, I just made central installs of black and pylint on rawtext.club
Do you want to discuss using TravisCI? or should I just close this issue?
We could come back to TravisCI or some automated task runner at a later date. It may be best to understand how it all works manually first. If you agree, lets close this off.
Another tool is 'mypy' to validate type hinting. I have been hinting types where possible, I'm not sure what you guys think about it but I like it.
Ok, installed mypy now (on rtc). I would like to learn more about TravisCI too. Travis works through hooks in the repo, right? Like an integration with Github? Does it work with Tildegit? Or can we use it directly from the shells where we're coding?
I have not used type hinting in python before. I have in PHP. I do not care for it in PHP (it doesnt actually handle types correctly in PHP and there are some edge cases that arent that far out on the edge that you can get in trouble with). So, not sure how well Pythons work. I have generally felt that if you want static typing use a language that does that, otherwise use dynamism to your full advantage... but I am good either way. It will be interesting to see how it works in Python, as I didnt even know that it was a thing.
I haven't tried using TravisCI, or something hosted locally, to integrate with Tildegit and automatically lint/test/package. It would be a bit of work to do so, and I think for the initial release we have enough in place to help in this area, so perhaps this can be deferred to a future release?