Skip to content

[Code Style] Changed code to match the tvm code style conventions. - #9040

Merged
masahi merged 7 commits into
apache:mainfrom
Raghav-Chakravarthy:main
Oct 22, 2021
Merged

[Code Style] Changed code to match the tvm code style conventions.#9040
masahi merged 7 commits into
apache:mainfrom
Raghav-Chakravarthy:main

Conversation

@Raghav-Chakravarthy

Copy link
Copy Markdown
Contributor

[Issue]
While reviewing the tvm code, I noticed some naming convention issues
in the diag_ctx_ and current_func variables.

Variable current_func should be current_func_ because it is a class
variable

Variable diag_ctx_ should be diag_ctx , because it is a public variable

[Solution]

Changed the variables to match the tvm code style conventions

@Raghav-ChakravarthyRaghav-Chakravarthy changed the title [Code Style Change] Changed code to match the tvm code style conventions.[Code Style] Changed code to match the tvm code style conventions.Sep 18, 2021
[Issue]
While reviewing the tvm code, I noticed some naming convention issues
in the diag_ctx_ and current_func variables.
Variable current_func should be current_func_ because it is a class
variable
Variable diag_ctx_ should be diag_ctx , because it is a public variable
[Solution]
Changed the variables to match the tvm code style conventions

@mbrookhartmbrookhart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

You have a lint issue, could you run make format and repush?

@Mousius

Copy link
Copy Markdown
Member

Hi @mbrookhart / @Raghav-Chakravarthy,

I actually made this mistake in another PR (#8951 (comment)), the actual rule is that all data members of a class should have the trailing _ (https://google.github.io/styleguide/cppguide.html#Variable_Names) and should actually all be private with accessor functions if necessary (https://google.github.io/styleguide/cppguide.html#Access_Control).

@Raghav-Chakravarthy would it be possible for you to update this PR accordingly?

@Raghav-Chakravarthy

Copy link
Copy Markdown
ContributorAuthor

@mbrookhart@Mousius

Sorry for the late response. I was busy with many school exams, and got a chance to look at the code this week.

All review comments have been addressed. Please let me know if anything else needs to be modified.

@areusch

Copy link
Copy Markdown
Contributor

@mbrookhart@Mousius could you take a look at this one? @Raghav-Chakravarthy could you fix the lint error?

@MousiusMousius left a comment

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.

Once the minor lint grievance is resolved, this is a great example of where following the conventions has lead to the code being cleaner and generally easier to read - thanks for this @Raghav-Chakravarthy!

@areusch

Copy link
Copy Markdown
Contributor

@Raghav-Chakravarthy please fix the lint error when you get a minute!

@Raghav-Chakravarthy

Copy link
Copy Markdown
ContributorAuthor

@Mousius@areusch

Sorry for the delayed response.

I will fix the error as soon as possible.

@Raghav-Chakravarthy

Copy link
Copy Markdown
ContributorAuthor

@Mousius@areusch
Thank you, I have fixed the linting errors.

@Raghav-Chakravarthy

Copy link
Copy Markdown
ContributorAuthor

@areusch@mbrookhart - Please take a look at my PR.

@masahi
masahi merged commit e830a1f into apache:mainOct 22, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
…pache#9040)
* [Code Style] Changed code to match the tvm code style conventions.
[Issue]
While reviewing the tvm code, I noticed some naming convention issues
in the diag_ctx_ and current_func variables.
Variable current_func should be current_func_ because it is a class
variable
Variable diag_ctx_ should be diag_ctx , because it is a public variable
[Solution]
Changed the variables to match the tvm code style conventions
* addressed comments
* removed debug logic
* fixed plint issue
* fixed building issue
* fixed whitespace issue
* fixed linting error in type_solver.cc
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…pache#9040)
* [Code Style] Changed code to match the tvm code style conventions.
[Issue]
While reviewing the tvm code, I noticed some naming convention issues
in the diag_ctx_ and current_func variables.
Variable current_func should be current_func_ because it is a class
variable
Variable diag_ctx_ should be diag_ctx , because it is a public variable
[Solution]
Changed the variables to match the tvm code style conventions
* addressed comments
* removed debug logic
* fixed plint issue
* fixed building issue
* fixed whitespace issue
* fixed linting error in type_solver.cc
Sign up for freeto 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.

5 participants

@Raghav-Chakravarthy@Mousius@areusch@mbrookhart@masahi