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 copyright notice in new files #116

Closed
rhgills opened this issue Dec 5, 2013 · 14 comments
Closed

Include copyright notice in new files #116

rhgills opened this issue Dec 5, 2013 · 14 comments

Comments

@rhgills
Copy link
Contributor

rhgills commented Dec 5, 2013

Both Xcode and AppCode should include Typhoon-specific copyright notices when creating new files.

This might be helpful for Xcode: http://stackoverflow.com/questions/5770126/how-can-i-change-the-copyright-template-in-xcode-4

Not sure if AppCode supports this, although IntelliJ appears to: http://www.jetbrains.com/idea/webhelp/generating-and-updating-copyright-notice.html

@rhgills
Copy link
Contributor Author

rhgills commented Dec 5, 2013

As a workaround, I added a Copyright Header.txt file to the root of the repository. All contributors should manually copy this copyright notice to all new files they create, and replace any existing, different copyright notices with this canonical one as they come across them.

@jasperblues
Copy link
Member

Nice work.

Perhaps we can add and link these in the contribution guide?

For AppCode I use the following features:

  • File templates - you can update the header for your current project.
  • Live templates - you can create a keyboard shortcut that inserts a code snippet. I have one called 'typhoon' which inserts the standard typhoon header.

@rhgills
Copy link
Contributor Author

rhgills commented Dec 8, 2013

The file templates and live templates seem to be of global scope, not project scope. So I could edit the header used for all new objective-C files, but that would affect all the projects I work on, not just Typhoon. I can't find any way to update the header only for the current project. Do you know how to do this?

Assuming that file templates are globally scoped, code snippets seem best. I now have a live template called 'typhoon_header' that inserts the correct copyright header. I know this is possible with Xcode as well.

I'll add some remarks to the contribution guide, including suggestions as to how to easily insert the canonical copyright notice.

@jasperblues
Copy link
Member

Yeah I think the file templates are global. . . I also raised a bug about this on the appcode tracker. . (I don’t recall if they enrolled it or explained how to do it). .

. . but anyway, the file template links to a filename that you can define. . so what I do now is set up a couple for the various projects, and switch by changing the link. . A bit tedious and not shareable.

Jasper Blues
Landline: +63.2.826.2489
Skype: jasperblues
LinkedIn Twitter

On Dec 9, 2013, at 3:38 AM, Robert Gilliam notifications@github.com wrote:

The file templates and live templates seem to be of global scope, not project scope. So I could edit the header used for all new objective-C files, but that would affect all the projects I work on, not just Typhoon. I can't find any way to update the header only for the current project. Do you know how to do this?

Assuming that file templates are globally scoped, code snippets seem best. I now have a live template called 'typhoon_header' that inserts the correct copyright header. I know this is possible with Xcode as well.

I'll add some remarks to the contribution guide, including suggestions as to how to easily insert the canonical copyright notice.


Reply to this email directly or view it on GitHub.

@rhgills
Copy link
Contributor Author

rhgills commented Dec 9, 2013

Ahh, I see. Very tedious! I'll probably end up manually replacing the notices in all new files using a snippet.

I've made some changes to (a fork) of the contribution guide, here: https://github.com/rhgills/Typhoon/wiki/Contribution-guide

Notably:

  • remove the section about building the Xcode project, which is the same as any other Xcode project
  • change from recommending MacPorts to install dependencies to the superior homebrew. Any objections to this?
  • officially recommend bundler for installing cocoapods and ensuring that all contributors to Typhoon are using the same version of cocoapods.
  • document required copyright notice, and suggest the use of a code snippet to ease the pain of following this requirement

Questions:

Includes Unit Tests, Integration Tests, Code Coverge and API reports installed to Xcode.

As soon as we're all in agreement I'll push these changes to the main wiki.

@rhgills
Copy link
Contributor Author

rhgills commented Dec 9, 2013

P.S. Made some changes to the home page as well, where we now link to the contribution guide.

https://github.com/rhgills/Typhoon/wiki

@drodriguez
Copy link
Contributor

I think git attributes can be used to include a predefined header block at the start of the files. I know git attributes are shared in the repository, but the filters go in config, so each contributor will have to modify their local configuration (which is kind of the same problem as with templates). Every file added or commited to the repository will include automatically the copyright (the filter script can also “detect” the standard Xcode header and strip out).

I can give it a look if you think is a good idea and see if a proof of concept works.

@rhgills
Copy link
Contributor Author

rhgills commented Dec 9, 2013

That's a great idea! 👍

It's less of a problem with this than with templates because here it is only a one time modification.

I look forward to seeing what you come up with!

@jasperblues
Copy link
Member

+1 on both the edits and the filter

@jasperblues
Copy link
Member

| Includes Unit Tests, Integration Tests, Code Coverge and API reports installed to Xcode.

Hah. That was supposed to mean just the API and coverage reports get generated, while the docs get generated and installed. . .

@rhgills
Copy link
Contributor Author

rhgills commented Dec 11, 2013

Ahh! Got away from you a bit I guess ;)

I'll clean that up and merge the changes into the wiki.

@jasperblues
Copy link
Member

Thanks! :)

@rhgills
Copy link
Contributor Author

rhgills commented Dec 11, 2013

Seems resolved to me, yes?

@rhgills rhgills closed this as completed Dec 11, 2013
@jasperblues
Copy link
Member

👍

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

No branches or pull requests

3 participants