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

remove unnecessary comments #88

Closed
wants to merge 1 commit into from

Conversation

camio
Copy link
Contributor

@camio camio commented Dec 5, 2024

These comments add clutter in my opinion. If someone is editing this file,
they can search google to learn more information about pre-commit. We
don't, for example, link to the CMake homepage from our CMakeLists.txt.

Additionally, the other comments here are pieces of reference documentation
elsewhere.

These comments add clutter in my opinion. If someone is editing this file,
they can search google to learn more information about pre-commit. We
don't, for example, link to the CMake homepage from our CMakeLists.txt.

Additionally, the other comments here are pieces of reference documentation
elsewhere.
@wusatosi
Copy link
Member

wusatosi commented Dec 5, 2024

Why are these comments considered unnecessary?

@camio
Copy link
Contributor Author

camio commented Dec 5, 2024

Why are these comments considered unnecessary?

Please see updated PR text.

@@ -8,25 +6,16 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

# Clang-format for C++
# This brings in a portable version of clang-format.
Copy link
Member

@wusatosi wusatosi Dec 5, 2024

Choose a reason for hiding this comment

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

I don't think this is not useful... This makes clear that pre-commit does not dependent on system's clang-format.

Copy link
Member

Choose a reason for hiding this comment

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

I mean they can certainly search for it. But I don't think this is non-dependency is intuitive.

- repo: https://github.com/BlankSpruce/gersemi
rev: 0.15.1
hooks:
- id: gersemi
name: CMake linting

# Markdown linting
# Config file: .markdownlint.yaml
Copy link
Member

Choose a reason for hiding this comment

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

There are multiple CMake linters using different file names for their linting file. This is useful for alleviate confusion when someone brings in another CMake lint config.

Copy link
Member

Choose a reason for hiding this comment

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

You can see an instance of this happening here:
https://github.com/bemanproject/inplace_vector/pull/14/files#r1842893309

@wusatosi
Copy link
Member

wusatosi commented Dec 5, 2024

Why are these comments considered unnecessary?

Please see updated PR text.

See review comment.

Edit: I also think exemplar should be as descriptive as it can be. We create exemplar so people don't have to search stuff up. CMake is a common utility but pre-commit isn't. It doesn't hurt to be more descriptive, the comments are designed not to expire (e.g. they don't attach to a specific version of the dependency).

Copy link
Member

@steve-downey steve-downey left a comment

Choose a reason for hiding this comment

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

I agree that the comments are useful documentation, as finding the right cross references for these is extra work.

@camio
Copy link
Contributor Author

camio commented Dec 6, 2024

Alright, I'm withdrawing this PR for now since there lacks consensus for it.

I maintain that the file is perfectly understandable without the comments since a) one can follow the link right below the comment to understand the semantics of what is being brought in, and b) googling for .pre-commit-config.yaml provides all the links necessary for understanding the utility of this file.

I also think exemplar should be as descriptive as it can be. We create exemplar so people don't have to search stuff up.

Exemplar's purpose is to exemplify best practices applied to a C++ repository, not to be a descriptive tutorial. Just as it is an anti-pattern to redundantly document the semantics of functions at their call sites, we should not document our tools where they are being used.

@camio camio closed this Dec 6, 2024
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.

4 participants