Skip to content
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

Include code format tools #37

Merged
merged 13 commits into from
Jun 4, 2021
Merged

Include code format tools #37

merged 13 commits into from
Jun 4, 2021

Conversation

kevinlind
Copy link
Collaborator

@kevinlind kevinlind commented May 25, 2021

Description

Includes code format tools to build system.

  • Adds Spotless configuration to Gradle scripts
  • Configures Spotless with Prettier in edgeconsent and app module (Java files)
  • Adds config/formatter/adobe.header.txt used by Spotless to apply copyright header to all Java files
  • Add Makefile targets to apply and check formatting by running Spotless gradle commands.
  • Add .githook folder with pre-commit hook to apply formatting on each commit. Include init Makefile target to set git's core.hooksPath to this folder.
  • Update README with formatting instructions.

Spotless is configured to format according to Google Java Code Style, however with tab indentation, indent size of 4, and 120 line width.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented May 25, 2021

Codecov Report

Merging #37 (4f93806) into dev (dbf1ab9) will increase coverage by 0.75%.
The diff coverage is 58.33%.

@@            Coverage Diff             @@
##              dev      #37      +/-   ##
==========================================
+ Coverage   73.95%   74.70%   +0.75%     
==========================================
  Files          13       13              
  Lines         403      411       +8     
  Branches       48       48              
==========================================
+ Hits          298      307       +9     
+ Misses         77       76       -1     
  Partials       28       28              
Flag Coverage Δ
functional-tests 54.50% <38.89%> (+0.90%) ⬆️
unit-tests 74.38% <61.17%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...arketing/mobile/edge/consent/ConsentConstants.java 0.00% <0.00%> (ø)
.../marketing/mobile/edge/consent/ConsentManager.java 100.00% <ø> (ø)
...obe/marketing/mobile/edge/consent/DateUtility.java 83.33% <0.00%> (+11.90%) ⬆️
...m/adobe/marketing/mobile/edge/consent/Utility.java 54.17% <0.00%> (+1.11%) ⬆️
...le/edge/consent/ListenerEdgeConsentPreference.java 66.67% <50.00%> (ø)
...arketing/mobile/edge/consent/ConsentExtension.java 70.64% <52.50%> (-1.47%) ⬇️
...m/adobe/marketing/mobile/edge/consent/Consent.java 60.42% <57.14%> (+3.89%) ⬆️
.../adobe/marketing/mobile/edge/consent/Consents.java 81.01% <64.71%> (+1.01%) ⬆️
...ing/mobile/edge/consent/ConsentStorageService.java 97.56% <87.50%> (+2.32%) ⬆️
.../consent/ListenerConfigurationResponseContent.java 91.67% <100.00%> (ø)
... and 3 more

Copy link
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than this, same comments apply as for edgeidentity

}
});
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this map can use a little help. can we simplify this by creating the inner maps in advance? - same below

"Received unexpected event with type: " +
receivedEvent.getKey().type +
" source: " +
receivedEvent.getKey().source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use String.format for improved readability

@emdobrin emdobrin merged commit 68556d3 into adobe:dev Jun 4, 2021
@kevinlind kevinlind deleted the spotless branch June 4, 2021 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants