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

Add a build step which validates each source file for the inclusion of our license header #46

Merged
merged 11 commits into from
Jan 29, 2016

Conversation

rastersize
Copy link
Contributor

This PR adds a build step which validates that all source files contains our license header. The script did find a few files which where missing it πŸ˜„

It also adds Travis-CI group folding to our different steps, to make the output pretties and easier to find.

Credits for the nice little diff command goes to @dflems πŸŽ‰

Example output

Validating source files for license compliance…
βœ“    "demo/AppDelegate.h"
βœ“    "demo/ClientKeys.h"
βœ“    "demo/NSString+OAuthBlob.h"
βœ“    "demo/PlaylistsViewController.h"
βœ“    "demo/PlaylistsViewModel.h"
βœ“    "demo/SPTDataLoaderAuthoriserOAuth.h"
βœ“    "demo/ViewController.h"
βœ“    "demo/AppDelegate.m"
βœ“    "demo/NSString+OAuthBlob.m"
βœ“    "demo/PlaylistsViewController.m"
βœ“    "demo/PlaylistsViewModel.m"
βœ“    "demo/SPTDataLoaderAuthoriserOAuth.m"
βœ“    "demo/ViewController.m"
βœ“    "demo/main.m"
βœ“    "include/SPTDataLoader/SPTCancellationToken.h"
βœ“    "include/SPTDataLoader/SPTDataLoader.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderAuthoriser.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderConsumptionObserver.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderConvenience.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderDelegate.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderExponentialTimer.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderFactory.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderRateLimiter.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderRequest.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderResolver.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderResponse.h"
βœ“    "include/SPTDataLoader/SPTDataLoaderService.h"
βœ“    "SPTDataLoader/NSDictionary+HeaderSize.h"
βœ“    "SPTDataLoader/SPTCancellationTokenFactory.h"
βœ“    "SPTDataLoader/SPTCancellationTokenFactoryImplementation.h"
βœ“    "SPTDataLoader/SPTCancellationTokenImplementation.h"
βœ“    "SPTDataLoader/SPTDataLoader+Private.h"
βœ“    "SPTDataLoader/SPTDataLoaderFactory+Private.h"
βœ“    "SPTDataLoader/SPTDataLoaderRequest+Private.h"
βœ“    "SPTDataLoader/SPTDataLoaderRequestResponseHandler.h"
βœ“    "SPTDataLoader/SPTDataLoaderRequestTaskHandler.h"
βœ“    "SPTDataLoader/SPTDataLoaderResolverAddress.h"
βœ“    "SPTDataLoader/SPTDataLoaderResponse+Private.h"
βœ“    "SPTDataLoader/NSDictionary+HeaderSize.m"
βœ“    "SPTDataLoader/SPTCancellationTokenFactoryImplementation.m"
βœ“    "SPTDataLoader/SPTCancellationTokenImplementation.m"
βœ“    "SPTDataLoader/SPTDataLoader.m"
βœ“    "SPTDataLoader/SPTDataLoaderExponentialTimer.m"
βœ“    "SPTDataLoader/SPTDataLoaderFactory.m"
βœ“    "SPTDataLoader/SPTDataLoaderRateLimiter.m"
βœ“    "SPTDataLoader/SPTDataLoaderRequest.m"
βœ“    "SPTDataLoader/SPTDataLoaderRequestTaskHandler.m"
βœ“    "SPTDataLoader/SPTDataLoaderResolver.m"
βœ“    "SPTDataLoader/SPTDataLoaderResolverAddress.m"
βœ“    "SPTDataLoader/SPTDataLoaderResponse.m"
βœ“    "SPTDataLoader/SPTDataLoaderService.m"
βœ“    "SPTDataLoaderTests/NSURLSessionDataTaskMock.h"
βœ“    "SPTDataLoaderTests/NSURLSessionMock.h"
βœ“    "SPTDataLoaderTests/NSURLSessionTaskMock.h"
βœ“    "SPTDataLoaderTests/SPTCancellationTokenDelegateMock.h"
βœ“    "SPTDataLoaderTests/SPTDataLoaderAuthoriserMock.h"
βœ“    "SPTDataLoaderTests/SPTDataLoaderConsumptionObserverMock.h"
βœ“    "SPTDataLoaderTests/SPTDataLoaderDelegateMock.h"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRequestResponseHandlerDelegateMock.h"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRequestResponseHandlerMock.h"
βœ“    "SPTDataLoaderTests/NSDictionaryHeaderSizeTest.m"
βœ“    "SPTDataLoaderTests/NSURLSessionDataTaskMock.m"
βœ“    "SPTDataLoaderTests/NSURLSessionMock.m"
βœ“    "SPTDataLoaderTests/NSURLSessionTaskMock.m"
βœ“    "SPTDataLoaderTests/SPTCancellationTokenDelegateMock.m"
βœ“    "SPTDataLoaderTests/SPTCancellationTokenFactoryImplementationTest.m"
βœ“    "SPTDataLoaderTests/SPTCancellationTokenImplementationTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderAuthoriserMock.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderConsumptionObserverMock.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderDelegateMock.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderExponentialTimerTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderFactoryTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRateLimiterTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRequestResponseHandlerDelegateMock.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRequestResponseHandlerMock.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRequestTaskHandlerTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderRequestTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderResolverAddressTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderResolverTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderResponseTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderServiceTest.m"
βœ“    "SPTDataLoaderTests/SPTDataLoaderTest.m"

βœ“ [SUCCESS] All source files contains the required license.


# License conformance
travis_fold_open "License conformance"
./ci/validate_license_conformance.sh {include/SPTDataLoader/*.h,SPTDataLoader/*.{h,m}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put the license validation after the general build actions. However as they run so fast, and they will fail the build, should we have the check before building and test? Wondering if that would make the fail/fix cycle quicker.

Downside to that is that you’d have to fix the license issue (trivial) before you’re even told about potential code failures.

@8W9aG
Copy link
Contributor

8W9aG commented Jan 27, 2016

I'm for putting it before the build, it seems like it is better to fail fast

@rastersize
Copy link
Contributor Author

@8W9aG Ok, I moved it.

@rastersize
Copy link
Contributor Author

This is ready for review @8W9aG @jgavris @dflems πŸ˜ƒ

@jgavris
Copy link
Contributor

jgavris commented Jan 27, 2016

Awesome efforts! I am mostly against merging 'revert' and 'fixup' commits into mainline from a topic branch. How do others feel about squashing into the winner commits?

@8W9aG
Copy link
Contributor

8W9aG commented Jan 27, 2016

I think each to their own on this issue, there are valid arguments for both

@rastersize
Copy link
Contributor Author

@jgavris @8W9aG @dflems Ready for review!

@jgavris I went ahead and squashed the commits a bit. It should be less noisy now. However I left the commits which do separate things separate. Also some commits would have been annoying to squash (specifically squashing 5d0cafa into 838963f) so I left those as-is.
😸

@8W9aG
Copy link
Contributor

8W9aG commented Jan 29, 2016

πŸ‘ Very nice

- This was hiding the reason for why our CI script started failing.
- Moves the sections around and groups them a bit more. This way the
matrix is at the end of the file. Taking up less visual space and also
only messing up the highlighting for itself.
- Quotes! Use quotes liberally when bashing.
- Make the travis_fold function take a heading title.
@8W9aG
Copy link
Contributor

8W9aG commented Jan 29, 2016

πŸ‘

1 similar comment
@jgavris
Copy link
Contributor

jgavris commented Jan 29, 2016

πŸ‘

rastersize added a commit that referenced this pull request Jan 29, 2016
Add a build step which validates each source file for the inclusion of our license header
@rastersize rastersize merged commit d532b23 into master Jan 29, 2016
@rastersize rastersize deleted the ci/validate-license branch January 29, 2016 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants