Skip to content

Paulbartell/add gitattributes #28

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Enable line-ending normalization
# Refer to https://git-scm.com/docs/gitattributes for more details.

# Unless excluded below, files with LF line endings in this repository will be:
# * converted to platform specific line endings on checkout and
# * converted back to the original line endings on commit
# Files with CRLF line endings will not be modified by git on checkout or commit.
* text=auto

# Platform specific files
# These will always have the specified line endings
*.sh text eol=lf
.bat text eol=crlf
.url text eol=crlf
63 changes: 0 additions & 63 deletions .github/actions/url_verifier.sh

This file was deleted.

8 changes: 5 additions & 3 deletions .github/scripts/kernel_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
KERNEL_IGNORED_FILES = [
'FreeRTOS-openocd.c',
'Makefile',
'.DS_Store'
'.DS_Store',
'uncrustify.cfg'
]

KERNEL_IGNORED_EXTENSIONS = [
Expand All @@ -60,7 +61,9 @@
'.png',
'.bat',
'.sh',
'.txt'
'.txt',
'.yml',
'.yaml'
]

KERNEL_ASM_EXTENSIONS = [
Expand Down Expand Up @@ -148,4 +151,3 @@ def main():

if __name__ == '__main__':
exit(main())

47 changes: 0 additions & 47 deletions .github/workflows/ci.yml

This file was deleted.

226 changes: 226 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
name: Format

on:
pull_request:
branches:
- "**"
jobs:
spelling:
name: Spelling
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Install Python"
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: "List Changed Files"
id: file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
with:
output: ' '
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Check Spelling
run: |
pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
codespell
linters:
name: Code Style
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Install Python"
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: "List Changed Files"
id: file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
with:
output: ' '
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: "Lint C code (uncrustify)"
run: |
pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
uncrustify

- name: "Lint other files"
run: |
pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
check-executables-have-shebangs

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
shellcheck

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
check-ast

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
check-json

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
check-yaml

compatibility:
name: Compatibility
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Install Python"
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: "List Changed Files"
id: file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
with:
output: ' '
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: "Emd of Line checks"
run: |
pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
trailing-whitespace

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
mixed-line-ending

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
fix-byte-order-marker

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
end-of-file-fixer

- name: "Filename conflicts"
run: |
pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
check-case-conflict

- name: "Version Control issues"
run: |
pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
git-dirty

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
forbid-binary

pre-commit run \
--files ${{ steps.file_changes.outputs.files_added}} \
${{ steps.file_changes.outputs.files_changed}} \
--show-diff-on-failure \
check-added-large-files
url-check:
name: Broken URLs
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Check Links
uses: FreeRTOS/CI-CD-GitHub-Actions/link-verifier@main
with:
path: ./
exclude-dirs: .git
include-file-types: .c,.h,.s,.S,.asm,.inc,.src,.s26,.s43,.s79,.s82,.s85,.s87,.s90,\
.json,.yaml,.yml,\
.md,.readme,.txt,.url,\
.bat,.sh,.py

file-headers:
name: File Headers
runs-on: ubuntu-latest
steps:
# Install python 3
- name: Tool Setup
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64

# There is shared code, hosted by FreeRTOS/FreeRTOS, with deps needed by header checker
- name: Checkout FreeRTOS Tools
uses: actions/checkout@v2
with:
repository: FreeRTOS/FreeRTOS
ref: main
path: tools

# Checkout user pull request changes
- name: Checkout Pull Request
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: inspect

- name: "List Changed Files"
id: file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4

# Run checks
- name: Check File Headers
run: |
cp -r tools/.github/scripts/common inspect/.github/scripts/
pip install -r tools/.github/scripts/common/requirements.txt
cd inspect
.github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json
exit $?
2 changes: 1 addition & 1 deletion .github/workflows/git-secrets.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: git-secrets Check
name: Git-Secrets
on:
push:
pull_request:
Expand Down
Loading