diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..1c33738acd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +end_of_line = lf +insert_final_newline = true diff --git a/Android.gitignore b/Android.gitignore index 39b6783cef..60f1e607f2 100644 --- a/Android.gitignore +++ b/Android.gitignore @@ -32,16 +32,6 @@ proguard/ # Android Studio captures folder captures/ -# IntelliJ -*.iml -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -.idea/caches - # Keystore files # Uncomment the following line if you do not want to check your keystore files in. #*.jks diff --git a/Android.yml b/Android.yml new file mode 100644 index 0000000000..859433393e --- /dev/null +++ b/Android.yml @@ -0,0 +1,2 @@ +editors: + - Global/JetBrains.gitignore diff --git a/C++.yml b/C++.yml new file mode 100644 index 0000000000..6c108f739d --- /dev/null +++ b/C++.yml @@ -0,0 +1,2 @@ +aliases: + - Fortran diff --git a/Clojure.gitignore b/Clojure.gitignore deleted file mode 120000 index 7657a270c4..0000000000 --- a/Clojure.gitignore +++ /dev/null @@ -1 +0,0 @@ -Leiningen.gitignore \ No newline at end of file diff --git a/Fortran.gitignore b/Fortran.gitignore deleted file mode 120000 index 5daba98a3e..0000000000 --- a/Fortran.gitignore +++ /dev/null @@ -1 +0,0 @@ -C++.gitignore \ No newline at end of file diff --git a/Global/JetBrains.gitignore b/Global/JetBrains.gitignore index 02d16aae38..629500fd98 100644 --- a/Global/JetBrains.gitignore +++ b/Global/JetBrains.gitignore @@ -1,6 +1,3 @@ -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml @@ -50,3 +47,6 @@ fabric.properties # Editor-based Rest Client .idea/httpRequests + +# Rider-specific rules +*.sln.iml diff --git a/Global/JetBrains.yml b/Global/JetBrains.yml new file mode 100644 index 0000000000..402f6507a4 --- /dev/null +++ b/Global/JetBrains.yml @@ -0,0 +1,11 @@ +aliases: + - IntelliJ + - RubyMine + - PhpStorm + - AppCode + - PyCharm + - CLion + - Android Studio + - WebStorm + - Rider +reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 \ No newline at end of file diff --git a/Global/Xcode.gitignore b/Global/Xcode.gitignore index cd0c7d3e45..b805012ee4 100644 --- a/Global/Xcode.gitignore +++ b/Global/Xcode.gitignore @@ -1,7 +1,3 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - ## User settings xcuserdata/ diff --git a/Global/Xcode.yml b/Global/Xcode.yml new file mode 100644 index 0000000000..66c67e5576 --- /dev/null +++ b/Global/Xcode.yml @@ -0,0 +1,3 @@ +aliases: + - Objective-C + - Swift diff --git a/Java.yml b/Java.yml new file mode 100644 index 0000000000..b1fd2ee603 --- /dev/null +++ b/Java.yml @@ -0,0 +1,2 @@ +aliases: + - Kotlin diff --git a/Kotlin.gitignore b/Kotlin.gitignore deleted file mode 120000 index c48376eebc..0000000000 --- a/Kotlin.gitignore +++ /dev/null @@ -1 +0,0 @@ -Java.gitignore \ No newline at end of file diff --git a/Leiningen.yml b/Leiningen.yml new file mode 100644 index 0000000000..4ad282bc6b --- /dev/null +++ b/Leiningen.yml @@ -0,0 +1,2 @@ +aliases: + - Clojure diff --git a/Objective-C.gitignore b/Objective-C.gitignore deleted file mode 100644 index 86de6aa3f5..0000000000 --- a/Objective-C.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output - -# Code Injection -# -# After new code Injection tools there's a generated folder /iOSInjectionProject -# https://github.com/johnno1962/injectionforxcode - -iOSInjectionProject/ diff --git a/Python.yml b/Python.yml new file mode 100644 index 0000000000..31450430a7 --- /dev/null +++ b/Python.yml @@ -0,0 +1,3 @@ +editors: + - Global/JetBrains.gitignore + - Global/VisualStudioCode.gitignore diff --git a/Swift.gitignore b/Swift.gitignore deleted file mode 100644 index 312d1f652c..0000000000 --- a/Swift.gitignore +++ /dev/null @@ -1,68 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output diff --git a/VisualStudio.gitignore b/VisualStudio.gitignore index f431ddc7cf..63ab0f8b7e 100644 --- a/VisualStudio.gitignore +++ b/VisualStudio.gitignore @@ -286,10 +286,6 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - # CodeRush .cr/ diff --git a/VisualStudio.yml b/VisualStudio.yml new file mode 100644 index 0000000000..00c4b81852 --- /dev/null +++ b/VisualStudio.yml @@ -0,0 +1,14 @@ +aliases: + - CSharp + - C# + - FSharp + - F# + - VisualBasic + - VB + +editors: + - Global/JetBrains.gitignore + - Global/VisualStudioCode.gitignore + +reviewers: + - Brendan Forster (@shiftkey) diff --git a/docs/metadata.md b/docs/metadata.md new file mode 100644 index 0000000000..99f71e7f95 --- /dev/null +++ b/docs/metadata.md @@ -0,0 +1,74 @@ +# Gitignore Metadata + +This document outlines the additional metadata that can be associated with a gitignore template, and how tools can consume this metadata. + +## Metadata Location + +To add additional metadata to a gitignore template, add a new file to the same directory, with the matching name but ending in `yml`. + +For example: + - for `C.gitignore` the associated metadata will be stored in `C.yml` + - for `Global/JetBrains.gitignore` the metadata file will be `Global/JetBrains.gitignore` + +## Supported Fields + +The structure of these files is still being settled upon, but for the moment these are some proposed entries. + +#### `aliases` + +Some templates can be used to represent a number of different situations, and rather than duplicating files on disk and needing to keep these in sync, we can store a list of these entries as metadata. + +For example, JetBrains has a unified gitignore template that can be applied to all of their IDEs. Previously these were stored as comments in the header: + +``` +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +``` + +These values can be represented as metadata, so that tools consuming this repository can use these entries as matches if the user is searching for a specific product: + +```yaml +aliases: + - IntelliJ + - RubyMine + - PhpStorm + - AppCode + - PyCharm + - CLion + - Android Studio + - WebStorm + - Rider +``` + +#### `editors` + +There are a number of editors out there that support working with different languages. Rather than baking every editor's rules in every language that is supported, a list of additional templates that might be of interest + +```yaml +editors: + - Global/JetBrains.gitignore + - Global/VisualStudioCode.gitignore +``` + +#### `reference` + +Some ecosystems have up-to-date documentation about things that are necessary to exclude from version control. To associate this with a template, this could be stored as a key-value pair in metadata: + +```yaml +reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +``` + +### `reviewers` + +This element is inspired by the [`DefinitelyTyped`](https://github.com/DefinitelyTyped/DefinitelyTyped) project, allowing community members to opt-in to reviewing templates when a pull request is opened. This helps to share the review load and credit people who have been helpful with reviews. + +```yaml +reviewers: + - @shiftkey +``` + +A friendly name can be provided alongside the GitHub account name. + +```yaml +reviewers: + - Brendan Forster (@shiftkey) +```