file formatting conventions for text files in our source repo #2138
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#2138
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This makes it so that emacs knows the intended character encoding, BOM, end-of-line markers, standard line-width, and tabs-vs-spaces policy for these files.
This is also a form of documentation. It means that you should put only utf-8-encoded things into text files, only utf-8-encoded things into source code files (and actually you should write only put ASCII-encoded things except possibly in comments or docstrings!), and that you should line-wrap everything at 77 columns wide.
It also specifies that text files should start with a "utf-8 BOM". (Brian questions the point of this, and my answer is that it adds information and doesn't hurt. Whether that information will ever be useful is an open question.)
It also specifies that text files should have unix-style end-of-line markers (i.e. '\n'), not windows-style or old-macos-style.
For Python source code files, it also specifies that you should not insert tab characters (so you should use spaces for Python block structure).
I generated this patch by writing and running the following script, and then reading the resulting diff to make sure it was correct. I then undid the changes that the script had done to the files inside the "setuptools-0.6c16dev4.egg" directory before committing the patch.
------- begin appended script::
(https://github.com/tahoe-lafs/tahoe-lafs/pull/77)
Oh wait, there is a bug in my script. Also I want to add
indent-tabs-mode: nil
since I just now had a bug due to automatically inserted tabs! brb.pull request: https://github.com/tahoe-lafs/tahoe-lafs/pull/78
I don't agree that the fill column for Python code should be 77. It's unnecessarily short and not consistent with the line wrapping in the majority of our existing code. wiki/CodingStandards says:
It's not clear that "-- coding: utf-8-with-signature-unix; fill-column: 77 --" is a valid Python source encoding declaration according to PEP 263. I don't know what Python actually implements, but the PEP doesn't require it to accept the full syntax accepted by emacs.
On the issue of BOMs, I'm with Brian in not seeing the point in adding them, especially for Python source code files that don't actually contain any non-ASCII characters (i.e. the vast majority of files in the Tahoe-LAFS source). And I do see harm in patches that touch large numbers of files, since that can create conflicts with other work in progress (granted, only trivial conflicts).
Note that enabling editor auto-wrapping for source code is generally a bad idea anyway. Wrapping should be done manually.
Comments comment:94261, comment:94262 and comment:94263 are my review; generally -1.