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

Fix whitespace, add .editorconfig, add GitHub workflow #883

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Conversation

prusnak
Copy link
Collaborator

@prusnak prusnak commented Apr 10, 2023

Followup to 9d634ef

@sw
Copy link
Contributor

sw commented Apr 11, 2023

Good idea!

Maybe add these to the .editorconfig:

indent_style = space
indent_size = 4

@prusnak
Copy link
Collaborator Author

prusnak commented Apr 11, 2023

Maybe add these to the .editorconfig:

I've added indent_style = space but not the indent_size = 4, since there are cases that do not follow that rule for a good reason, such as:

llama.cpp/llama.h

Lines 85 to 88 in 2663d2c

LLAMA_API int llama_model_quantize(
const char * fname_inp,
const char * fname_out,
int itype);

or

llama.cpp/llama.cpp

Lines 251 to 252 in 2663d2c

throw format("overflow multiplying %llu * %llu",
(unsigned long long) a, (unsigned long long) b);

@prusnak prusnak force-pushed the editor-config branch 2 times, most recently from 9025a47 to 9382756 Compare April 11, 2023 15:05
@j-f1
Copy link
Collaborator

j-f1 commented Apr 11, 2023

I think adding indent_size = 4 would be reasonable here — those cases technically aren’t indentation, they’re alignment. Setting indent_size helps with when people e.g. start a new block and have to indent, since users may have a default indent size of 2 or 3 instead of 4.

@prusnak
Copy link
Collaborator Author

prusnak commented Apr 11, 2023

those cases technically aren’t indentation, they’re alignment.

If I add it, the editorconfig-checker complains. I'll gladly update the PR if you tell me how.

@j-f1
Copy link
Collaborator

j-f1 commented Apr 11, 2023

The issue for the checker is here: editorconfig-checker/editorconfig-checker#182

In the meantime, you could disable the IndentSize check.

@prusnak
Copy link
Collaborator Author

prusnak commented Apr 11, 2023

In the meantime, you could disable the IndentSize check.

Implemented in 303c5ca

@sw sw merged commit 8b67998 into master Apr 11, 2023
@prusnak prusnak deleted the editor-config branch April 11, 2023 19:52
@slaren
Copy link
Collaborator

slaren commented Apr 12, 2023

This forces my prompts .txt files to end with a new line, which is not great. I added this to the .editorconfig which seems to work, but we may want to consider a better solution:

[*.txt]
insert_final_newline = false

@prusnak
Copy link
Collaborator Author

prusnak commented Apr 12, 2023

want to consider a better solution:

This works for me:

[prompts/*.txt]
insert_final_newline = unset
trim_trailing_whitespace = unset

Created a PR #908 - please test

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