Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
1vanK committed Nov 14, 2024
1 parent 0cceb5f commit a7dfb89
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 271 deletions.
143 changes: 0 additions & 143 deletions .github/workflows/15_puzzle.yml

This file was deleted.

122 changes: 0 additions & 122 deletions .github/workflows/big_int.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .github/workflows/clicker.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Clicker
name: CI/CD

on:
push:
paths: 'games/clicker/**'
pull_request:
paths: 'games/clicker/**'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -44,7 +42,7 @@ jobs:

- name: Генерируем проекты
run: |
cmake repo/games/clicker -B build -G "Unix Makefiles" \
cmake repo -B build -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=${{ matrix.compiler.c }} -D CMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D DV_ALL_WARNINGS=1 -D DV_CTEST=1
Expand All @@ -54,7 +52,6 @@ jobs:
cmake --build build
- name: CTest
shell: bash
run: |
xvfb-run ctest --verbose --test-dir build --timeout 60
Expand Down Expand Up @@ -92,7 +89,7 @@ jobs:
- name: Генерируем проекты
shell: bash
run: |
args=(repo/games/clicker -B build)
args=(repo -B build)
if [ "${{ matrix.compiler }}" == "vs" ]
then
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# https://git-scm.com/docs/gitignore
# https://www.atlassian.com/ru/git/tutorials/saving-changes/gitignore

# Игнорируем папки, которые создаёт VS Code
/.vscode/
/build/
40 changes: 40 additions & 0 deletions remove_spaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Удаляет пробелы в конце строк

import os


def get_newline(file_path):
with open(file_path, 'rb') as file:
content = file.read()

if b'\r\n' in content:
return '\r\n'
else:
return '\n'


def remove_trailing_spaces(file_path):
with open(file_path, 'r', encoding='utf-8') as file:
lines = file.readlines()

# Сохраняем формат разделителя строк
nel = get_newline(file_path)

with open(file_path, 'w', encoding='utf-8', newline=nel) as file:
for line in lines:
file.write(line.rstrip() + '\n')


if __name__ == '__main__':
repo_dir = os.path.dirname(os.path.realpath(__file__))
exts = {'.bat', '.sh', '.md', '.hpp', '.cpp', '.txt', '.py', '.yml', '.editorconfig', '.gitattributes', '.gitignore'}

for root, dirs, files in os.walk(repo_dir):
if '.git' in dirs: # Не заходим в папку .git
dirs.remove('.git')

for file in files:
if any(file.endswith(ext) for ext in exts):
file_path = os.path.join(root, file)
remove_trailing_spaces(file_path)
print('Обработан файл: ' + file_path)

0 comments on commit a7dfb89

Please sign in to comment.