Skip to content

Commit c059320

Browse files
Move IntelliJ code style & copyright configuration to project-level settings (#2652)
* Move IntelliJ code style & copyright configuration to project-level ## Motivation We currently expose IntelliJ code style & copyright configuration as standalone config files that users must manually import into their IDE. The import process is not too tedious, since the files are stored in Git (and thus readily available at the project level), but it requires users to know to find and import these files, and it's an unnecessary manual step for new users to be able to contribute. IntelliJ makes it easy to share configuration at the project-level. With its .idea directory structure, we can manually choose which files to share in Git. Then any user cloning the project will automatically use our recommended settings. Another benefit of this approach is that any changes to the existing code style will be automatically shared and synced with users when they pull the latest version. ## Modifications * Copy intellij-codestyle.xml to project-level settings (and remove the old file) * Copy intellij-copyright-profile.xml to project-level settings (and remove the old file) * Update gitignore to not ignore the directories for these specific project-level settings * Update the GettingStarted guide accordingly ## Notes To generate the project-level code style, I used the existing intellij-codestyle.xml and performed the IntelliJ "copy to project" action. This resulted in some slight differences, like reordering of elements and elements like "GENERATE_FINAL_LOCALS" no longer being present, but from what I can tell this is due to them specifying the same as the default behavior. ## Resources https://stackoverflow.com/questions/9087439/how-to-share-code-style-settings-between-developers-in-intellij https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 https://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder
1 parent 89c6d6f commit c059320

File tree

8 files changed

+72
-88
lines changed

8 files changed

+72
-88
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"category": "AWS SDK for Java v2",
3+
"contributor": "",
4+
"type": "documentation",
5+
"description": "Move IntelliJ code style & copyright configuration to project-level settings"
6+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
.settings/
55

66
# Intellij
7-
.idea/
7+
.idea/*
88
*.iml
99
*.ipr
1010
*.iws
11+
# IntelliJ un-ignore
12+
!.idea/codeStyles/
13+
!.idea/copyright/
1114

1215
# Mac
1316
.DS_Store

.idea/codeStyles/Project.xml

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build-tools/src/main/resources/software/amazon/awssdk/intellij-codestyle.xml

Lines changed: 0 additions & 68 deletions
This file was deleted.

docs/GettingStarted.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
generator][codegen]
88

99
### Development Environment Setup Tips
10-
If you use IntelliJ IDEA, we include some helpful config files that will make your development experience smoother:
11-
- [intellij-codestyle.xml](https://raw.githubusercontent.com/aws/aws-sdk-java-v2/master/build-tools/src/main/resources/software/amazon/awssdk/intellij-codestyle.xml)
10+
If you use IntelliJ IDEA, we recommend using the following config files, which will be used by default for your project-level settings:
1211

12+
- [Code style](https://raw.githubusercontent.com/aws/aws-sdk-java-v2/master/.idea/codeStyles/Project.xml)
13+
1314
This will help ensure your code follows our code style guidelines.
1415

15-
- [intellij-copyright-profile.xml](https://raw.githubusercontent.com/aws/aws-sdk-java-v2/master/build-tools/src/main/resources/software/amazon/awssdk/intellij-copyright-profile.xml)
16+
- [Copyright](https://raw.githubusercontent.com/aws/aws-sdk-java-v2/master/.idea/copyright/AWS_Java_SDK_2_0.xml)
1617

1718
This automatically inserts the license header to the top of source files that you create.
1819

0 commit comments

Comments
 (0)