Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

[FLOSS H1] build server check: only allow a-z, 0-9 and _ for file names #1615

Closed
markus2330 opened this issue Oct 6, 2017 · 6 comments · Fixed by #4171
Closed

[FLOSS H1] build server check: only allow a-z, 0-9 and _ for file names #1615

markus2330 opened this issue Oct 6, 2017 · 6 comments · Fixed by #4171
Assignees

Comments

@markus2330
Copy link
Contributor

We have inconsistent use of characters in file names, which always requires one to think which kind of separator is used in specific cases.

~e> find . -name '*-*' | wc -l
386
~e> find . -name '*_*' | wc -l
491
~e> find . -name '* *' | wc -l
0

As short time goal we should not introduce new variants (such as spaces, see #1613), as 1.0 goal I propose to unify it to a single variant.

@markus2330
Copy link
Contributor Author

markus2330 commented Mar 30, 2018

Latest results:

~e> find . -name '*-*' | grep -v "^./.git/" | wc -l                                                                                                                                                                                          
416
~e> find . -name '*_*' | grep -v "^./.git/" | wc -l                                                                                                                                                                                          
538

Ideally we would have a script that automatically renames everything based on conventions, in the same way we have it with clang-format. I'd prefer not to have to discuss about such conventions 😉

At the moment find . | grep -v '^[-_/.a-zA-Z0-9]*$' seems to be clean, we could add a check for this, see #160.

@markus2330 markus2330 added build and removed proposal labels Jun 20, 2019
@markus2330
Copy link
Contributor Author

The guideline now is find . -not -regex '[/.a-zA-Z0-9_-]*' should not find your file names. We should add a build server task to check this, #160.

markus2330 pushed a commit that referenced this issue Jun 20, 2019
file names see #1615
line endings see #2801
@markus2330 markus2330 changed the title only use a-z, 0-9 and _ for file names build server check: only allow a-z, 0-9 and _ for file names Oct 29, 2019
This was referenced Oct 14, 2020
@stale
Copy link

stale bot commented Oct 12, 2021

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added the stale label Oct 12, 2021
@markus2330 markus2330 added 1p one point cm2022s for university course labels Oct 13, 2021
@max-thoma
Copy link
Contributor

max-thoma commented Oct 20, 2021

[FLOSS H1]

When I run find . | grep -v '^[-_/.a-zA-Z0-9]*$', I get this output.

./.idea/fileTemplates/includes/C File Header.h
./build/doc/html/functions_~.html
./build/doc/html/functions_func_~.html
./build/doc/html/org.libelektra.docset/Contents/Resources/Documents/functions_~.html
./build/doc/html/org.libelektra.docset/Contents/Resources/Documents/functions_func_~.html
./build/doc/man/man3elektra/std_hash_ kdb_Key _.3elektra

As far as I can tell these violations are only in the build directory, so I can confirm the guideline is not violated by the project.

@stale stale bot removed the stale label Oct 20, 2021
@max-thoma max-thoma self-assigned this Oct 20, 2021
@markus2330
Copy link
Contributor Author

@muskater it is easier to do such verification in a clean clone.

I also tried the command, and ./.idea/fileTemplates/includes/C File Header.h seems to be an actual violation. Can you check if this name is required by idea? If yes, it is probably best to simply allow this file and add an exception to the check. (Ideally in a separated whitelist file tests/filenames.whitelist, like tests/linkchecker.whitelist.)

@markus2330 markus2330 changed the title build server check: only allow a-z, 0-9 and _ for file names [FLOSS H1] build server check: only allow a-z, 0-9 and _ for file names Oct 21, 2021
@max-thoma
Copy link
Contributor

CLion requires the template name to be C File Header.h. I have tried many different ways to rename and or re-add the file. However, all of them failed and CLion complaint not being able to find the template.

Having a template for header files is definitely a nice addition. I agree, the best solution would be to have a separate allow list for these kind of corner cases.

max-thoma added a commit to max-thoma/libelektra that referenced this issue Dec 15, 2021
…onform to the file naming convention as discussed in ElektraInitiative#1615. This script is executed at the cirrus CI and the Jenkins CI.
flo91 pushed a commit to flo91/libelektra that referenced this issue Dec 17, 2021
…onform to the file naming convention as discussed in ElektraInitiative#1615. This script is executed at the cirrus CI and the Jenkins CI.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants