From 37899dbdd3a4aa0d3bb0711d39b1431b0bbbae92 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sat, 30 Mar 2024 01:09:50 +0100 Subject: [PATCH] #405 add file header template directions to contributing + formatting --- CONTRIBUTING.md | 9 +++++ .../TemplateInfo.plist | 21 ++++++----- .../___FILEBASENAME___.swift | 36 +++++++++---------- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 304be90e..adbda8a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -136,6 +136,15 @@ The Xcode debugger often doesn't work as expected for Scribe as the keyboards th - When you get a window telling you to "choose an app to run", don't choose Scribe as you might expect, but instead scroll down and select Xcode Previews - Occasionally you'll be met with just a black screen on startup, in which case you can press Home (or ⇧-⌘-H) and then go directly to Scribe or an app for keyboard testing +### Adding the file header template to Xcode + +As [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) licensed technology, Scribe is expected to include a license header in all files within the codebase. A template for this has been provided in the `ScribeTemplates` directory. You can have this header automatically added to the top of files by executing the following commands to add it to your Xcode templates: + +```bash +mkdir ~/Library/Developer/Xcode/Templates +ln -s PATH_TO_LOCAL_SCRIBE_DIRECTORY/Scribe-iOS/ScribeTemplates ~/Library/Developer/Xcode/Templates/ +``` + # Issues and projects [`⇧`](#contents) diff --git a/ScribeTemplates/ScribeHeader.xctemplate/TemplateInfo.plist b/ScribeTemplates/ScribeHeader.xctemplate/TemplateInfo.plist index db8f25b4..aa2b07a1 100644 --- a/ScribeTemplates/ScribeHeader.xctemplate/TemplateInfo.plist +++ b/ScribeTemplates/ScribeHeader.xctemplate/TemplateInfo.plist @@ -1,15 +1,14 @@ - - Identifier - com.example.templates.mytemplate - Kind - Xcode.IDEKit.TextSubstitutionFileTemplateKind - Ancestors - - com.apple.dt.unit-test-class - - + + Identifier + com.example.templates.mytemplate + Kind + Xcode.IDEKit.TextSubstitutionFileTemplateKind + Ancestors + + com.apple.dt.unit-test-class + + - diff --git a/ScribeTemplates/ScribeHeader.xctemplate/___FILEBASENAME___.swift b/ScribeTemplates/ScribeHeader.xctemplate/___FILEBASENAME___.swift index 8df242ab..fafa9129 100644 --- a/ScribeTemplates/ScribeHeader.xctemplate/___FILEBASENAME___.swift +++ b/ScribeTemplates/ScribeHeader.xctemplate/___FILEBASENAME___.swift @@ -1,18 +1,18 @@ -/** - * [Describe what you want to do with your file here] - * - * Copyright (C) 2023 Scribe - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +/** + * DESCRIPTION_OF_THE_PURPOSE_OF_THE_FILE + * + * Copyright (C) 2023 Scribe + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */