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

Add to python linting to ensure that class arguments are the first element of the arglist #5876

Closed
lokijuhy opened this issue Nov 16, 2018 · 10 comments · Fixed by #5919
Closed

Comments

@lokijuhy
Copy link
Contributor

Check all python functions and make sure if the class args self or cls appear in the arguments of a function definition, that they are listed first.

This logic should probably live in scripts/pre_commit_linter.py.

See this conversation for background: #5844 (comment)

@anubhavsinha98
Copy link
Contributor

Hey @lokijuhy can I take this issue ?

@lokijuhy
Copy link
Contributor Author

Yes, go ahead!

@anubhavsinha98
Copy link
Contributor

Yes assign me this issue !

@lokijuhy
Copy link
Contributor Author

I don't think I have the power to assign the issue. @seanlip is assigning an issue a protected action?

@anubhavsinha98
Copy link
Contributor

ok! By the way, I have to just make a logic in pre_commiit_linter.py or do anything else?

@lokijuhy
Copy link
Contributor Author

Yes, this probably just involves extending pre_commit_linter.py.

@anubhavsinha98
Copy link
Contributor

Can we talk on gitter ?

@anubhavsinha98
Copy link
Contributor

Or I have to make a checker using AST (asteroid) ?

@anubhavsinha98
Copy link
Contributor

Hey, I have added a logic and made a PR #5916 !
Please check it!

@seanlip
Copy link
Member

seanlip commented Nov 28, 2018

@lokijuhy sorry for the late reply!

In general when a contributor has merged 2 PRs, we invite them to collaborate on the Oppia repository. At that point, they gain rights to update issue assignments etc. (We used to do it immediately on signup before but that resulted in way too much churn.)

@anubhavsinha98 -- as an FYI, in the initial phase (before 2 PRs are merged), it's fine to just claim an issue by making a comment on it. It won't necessarily be held (since sometimes folks say they want to work on an issue and then disappear), but at least other people know you're looking into it, and you're always still welcome to go ahead and submit a PR (as you've done).

anubhavsinha98 pushed a commit to anubhavsinha98/oppia that referenced this issue Nov 28, 2018
apb7 pushed a commit that referenced this issue Dec 22, 2018
… should come first. (#5919)

* First

* First

* Second

* Third

* Fourth

* Fixes:#5876

* Fixes:5876

* Fixes:5876

* Fixes:5876

* AST Approach

* AST Approach

* AST Approach

* AST Approach

* AST Approach

* AST Approach

* Solved Two Linting Errors

* Solved Two Linting Errors

* Solved Two Linting Errors

* Solved Two Linting Errors

* Solved Two Linting Errors

* Solved Two Linting Errors

* Solved Two Linting Errors

* Travis CI was not building

* Custom Check for Args Order

* Custom Check for Args Order

* Custom Check for Args Order

* Custom Check for Args Order

* Added More Tests and resolved merge conflicts

* Added More Tests and resolved merge conflicts

* Added More Tests and resolved merge conflicts

* Requested changes done

* Added fullstop

* Added fullstop

* Added docstring

* Changes made
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants