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

Убирает пустые строки в списках из CHANGELOG.md #5673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TatianaFokina
Copy link
Member

Описание

Сейчас при записи изменений в файлик с ченджлогом между пунктами списков добавляются пробелы. Попыталась исправить эту мелочь.

image

@TatianaFokina TatianaFokina added улучшение Доработка существующего кухня Документация, репозиторий, задачи редакции labels Jan 27, 2025
@TatianaFokina TatianaFokina self-assigned this Jan 27, 2025
Copy link

Превью контента из опубликовано.

Copy link
Member

@solarrust solarrust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@@ -84,7 +84,7 @@ if (addedContentList.length > 0) {
changelog.splice(headerPosition, 0, ...[header, "", ""]);
changelog.splice(headerPosition + 2, 0, ...addedContentList);
}
fs.writeFileSync(changelogFileName, changelog.join("\n"));
fs.writeFileSync(changelogFileName, changelog.filter(line => line.trim() !== "" || line.startsWith("##")).join("\n"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а тут всё ок с условием в колбэке ?
Мне кажется, мы попадаем в или только если line.trim() === "" .
Может можно упростить:

 fs.writeFileSync(changelogFileName, changelog.filter(line => line.trim() !== "").join("\n"));
Comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
кухня Документация, репозиторий, задачи редакции улучшение Доработка существующего
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants