Skip to content

Cargo.lock should be uncommentable #1168

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

Open
sorairolake opened this issue Apr 10, 2025 · 0 comments · May be fixed by #1169
Open

Cargo.lock should be uncommentable #1168

sorairolake opened this issue Apr 10, 2025 · 0 comments · May be fixed by #1169

Comments

@sorairolake
Copy link
Contributor

At #1060, Cargo.lock was changed to allow Python-style comments.

The following is the beginning of Cargo.lock:

# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4

First, add copyright and licensing into the headers of Cargo.lock:

reuse annotate -c "John Doe" -l "Apache-2.0 OR MIT" -y "2025" Cargo.lock

The result is the following:

diff --git a/Cargo.lock b/Cargo.lock
index 4679bcd..011829c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,3 +1,7 @@
+# SPDX-FileCopyrightText: 2025 John Doe
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+
 # This file is automatically @generated by Cargo.
 # It is not intended for manual editing.
 version = 4

Next, update Cargo.lock:

cargo update

The result is the following:

diff --git a/Cargo.lock b/Cargo.lock
index 011829c..c817aa7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,9 +1,8 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
 # SPDX-FileCopyrightText: 2025 John Doe
 #
 # SPDX-License-Identifier: Apache-2.0 OR MIT
-
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
 version = 4
 
 [[package]]

As the result, cargo update changes Cargo.lock to start with the notification that the file is generated. Cargo.lock is not intended to be edited manually, so I think it should be uncommentable.

@sorairolake sorairolake linked a pull request Apr 16, 2025 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant