FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ruff rule N805: First argument of a method should be named `self` by cclauss · Pull Request #339 · cpplint/cpplint · GitHub

ruff rule N805: First argument of a method should be named self - #339

Merged
cclauss merged 2 commits into
developfrom
first_argument_of_a_method_should_be_named_self
Mar 16, 2025
Merged

ruff rule N805: First argument of a method should be named self#339
cclauss merged 2 commits into
developfrom
first_argument_of_a_method_should_be_named_self

Conversation

cclauss commented Mar 16, 2025

Copy link
Copy Markdown
Member

This code is not deleting the function (method) but is instead deleting the class!

https://docs.astral.sh/ruff/rules/invalid-first-argument-name-for-method

cclauss force-pushed the first_argument_of_a_method_should_be_named_self branch from f8eb245 to 5c6617c Compare March 16, 2025 13:11
cclauss requested review from aaronliu0130 and jayvdb March 16, 2025 13:24

aaronliu0130 left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
  1. I forgot why I made it delete a parameter...
  2. Are you sure that's true?

The names of the test cases generated by @parameterized.expand can be customized using the name_func keyword argument. The value should be a function which accepts three arguments: testcase_func, param_num, and params, and it should return the name of the test case. testcase_func will be the function to be tested, param_num will be the index of the test case parameters in the list of parameters, and param (an instance of param) will be the parameters which will be used.

In my testing, the "fun" parameter pre-rename was indeed a string, and making the signature (self, fun, _, x) did not produce the results expected and I think even threw errors.

cclauss commented Mar 16, 2025

Copy link
Copy Markdown
Member Author

The value should be a function

This is a method, not a function.

cclauss requested a review from aaronliu0130 March 16, 2025 19:50

aaronliu0130 commented Mar 16, 2025
edited
Loading

Copy link
Copy Markdown
Member

Will rebase. (It said 3 files left unchanged for me though...)

aaronliu0130 force-pushed the first_argument_of_a_method_should_be_named_self branch from 333e054 to f1a03ef Compare March 16, 2025 21:12
aaronliu0130 force-pushed the first_argument_of_a_method_should_be_named_self branch from f1a03ef to a9f59ef Compare March 16, 2025 21:19

Copy link
Copy Markdown
Member

Had to reword 79febcb because apparently commit msg lines starting with "#" are not ignored...

cclauss merged commit 091845c into develop Mar 16, 2025
cclauss deleted the first_argument_of_a_method_should_be_named_self branch March 16, 2025 23:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL