Skip to content

add newline at end of file where it's lacking#353

Merged
majcosta merged 1 commit into
1dot13:masterfrom
majcosta:pr_add_newlines
Dec 14, 2024
Merged

add newline at end of file where it's lacking#353
majcosta merged 1 commit into
1dot13:masterfrom
majcosta:pr_add_newlines

Conversation

@majcosta
Copy link
Copy Markdown
Contributor

.editorconfig already enforces it but it's getting changed piecemeal in every commit. just get it done with.

the script:


find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
	isFile=$(file -0 "$file" | cut -d $'\0' -f2)
	case "$isFile" in
		(*text*)
			echo "$file is text"
			if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
				echo "" >> "$file"
			fi
			;;
		(*)
			echo "file isn't text"
			;;
	esac
done

.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.

the script:
```

find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
	isFile=$(file -0 "$file" | cut -d $'\0' -f2)
	case "$isFile" in
		(*text*)
			echo "$file is text"
			if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
				echo "" >> "$file"
			fi
			;;
		(*)
			echo "file isn't text"
			;;
	esac
done
```
@majcosta majcosta merged commit 86ad401 into 1dot13:master Dec 14, 2024
@majcosta majcosta deleted the pr_add_newlines branch December 14, 2024 22:05
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.

1 participant