[ANN] Copyright 1.0.0 RC1 for IDEA 5.x

I have just posted a brand new version of my Copyright Notice plugin for IDEA 5.x.

This is a complete rewrite of the plugin and it now supports copyright notices for Java, JavaScript, JSP, JSPx, HTML, xHTML, XML, DTD, CSS, and Properties files.

This is really a beta release so I would greatly appreciate any feedback - good or bad. Be sure to read the README file that is installed with the plugin or you can read the same contents from the Overview tab in the Copyright configuration screen.

This plugin was compiled with JDK 1.5 so you must run IDEA with 1.5 as well.

Enjoy.

Rick

14 comments

The default for Properties files is a single line. Can you make it 3
lines like the rest. It's pretty easy to over-look the single line.

Rick Maddy wrote:

I have just posted a brand new version of my Copyright Notice plugin for IDEA 5.x.

>

This is a complete rewrite of the plugin and it now supports copyright notices for Java, JavaScript, JSP, JSPx, HTML, xHTML, XML, DTD, CSS, and Properties files.

>

This is really a beta release so I would greatly appreciate any feedback - good or bad. Be sure to read the README file that is installed with the plugin or you can read the same contents from the Overview tab in the Copyright configuration screen.

>

This plugin was compiled with JDK 1.5 so you must run IDEA with 1.5 as well.

>

Enjoy.

>

Rick

0

Is the copyright text still kept in the .ipr?

If so, is it possible to store it in the config directory instead? I
like to have $Header$ and $Log$ after the notice so I can quickly scan
what happened to the file, but these will cause corruption when they are
merged on update.

Rick Maddy wrote:

I have just posted a brand new version of my Copyright Notice plugin for IDEA 5.x.

>

This is a complete rewrite of the plugin and it now supports copyright notices for Java, JavaScript, JSP, JSPx, HTML, xHTML, XML, DTD, CSS, and Properties files.

>

This is really a beta release so I would greatly appreciate any feedback - good or bad. Be sure to read the README file that is installed with the plugin or you can read the same contents from the Overview tab in the Copyright configuration screen.

>

This plugin was compiled with JDK 1.5 so you must run IDEA with 1.5 as well.

>

Enjoy.

>

Rick

0

The problem is that Properties don't have block comments. Maybe what would make sense is if block comments are selected for a language that only has line comments then I can simulate the block look by adding an empty comment before and after.

What do you think?

Rick

0

Project level config is stored in the ipr file and module level config is stored in the iml file. This is all done for free for me by the plugin architecture.

It will get quite complicated for me to do anything else.

I see your issue because when you use CVS to update your ipr file, the copyright's $Header$ string will get modified.

I'll look into escaping and $foo$ type strings in copyright notices so CVS does mess with them.

Rick

0

Very nice. This is a nice upgrade from the previous version.

Questions:

Did you intentionally remove the Update Copyright menu option from the right-click menu of the editor window?

Can you set it so that copyrights are automatically inserted for non-readonly files that do not have them? Right now it appears that copyrights are only updated if they already exist.

0

Yes, I removed Update Copyright from the context menu of the editor. My goal was to have Update Copyright be consistent with Optimize Imports where it made sense.

I may put it back because I used it from there quite a lot myself and I keep trying to do so now with the new version. It's really only an issue for those of use that are used to the previous versions.

Copyrights should be added to any writable file that doesn't have an existing copyright. Copyrights even get added to brand new files you create. I just tried it and it worked just fine.

Pull up a supported file with no current copyright in an editor. Click on the Code menu and select Update Copyright. Press Run on the Update Copyright dialog. There should now be a copyright.

If there isn't then please send me the file and let me know if you are getting any sort of exception (is there is little red flashing circle in the right end of the IDEA status bar?).

Rick

0

re: auto inserting of copyright

I think the problem is that most of the time I'm viewing a read-only version of a file. Then when I decide I need to edit it I check it out and the copyright is not inserted at that point even thought the file is now read/write. My project is using VSS for version control (yes, it sucks bad) so this is pretty much the usual way things work anytime we're gonna work with a file

0

One more thing...

Could you make it an option to use the "<!-- -->" form of block comments for JSP files? The kind it currently defaults to are fine but are not transmitted in the source to the browser.

0

A file becoming read/write is not a good trigger to auto update the copyright notice on an existing file.

If you have a set of files with no copyright I suggest you do a one time task of getting the whole project as read/write. Do one big Update Copyright from the top level and then commit the changed files.

Rick

0

"A file becoming read/write is not a good trigger to auto update the copyright notice on an existing file."

Why do you say that? I don't see an issue with it especially if it's a user selectable option.

If you're stuck using VSS for version control it's near impossible to make the mass changes you are talking about to a code base. Files are ALWAYS checked out. It's just one of the limitations of using such a crap version control system. Trust me, if we were using CVS or Subersion, we wouldn't be having this conversation. :)

0

I'm just uneasy with the idea of auto-modifying a file just because it become writable. I'll have to give it some thought.

I hear your pain though. Let me ask you this - how have you dealt with other "code cleanup" such as optimizing imports? Do you just not do it?

Are you aware of any functionality in IDEA or any other plugin that auto-modifies a file when it becomes writable? If there is such a precedant I might be more open to such a change.

Thanks for the feedback.
Rick

0

That is exactly what I was thinking

#

  1. .......

#

Rick Maddy wrote:

The problem is that Properties don't have block comments. Maybe what would make sense is if block comments are selected for a language that only has line comments then I can simulate the block look by adding an empty comment before and after.

>

What do you think?

>

Rick

0

" Let me ask you this - how have you dealt with other "code cleanup" such as optimizing imports? Do you just not do it?"

The short answer is, yes we just don't do it. The only refactoring we do is stuff that effects a single file or small set of files that we know are not checked out. Large scale refactors are strongly avoided. It's simply too painful. VSS is the work of Satan and I passionately despise it. It's core function I believe is to inhibit productivity and quality.

"Are you aware of any functionality in IDEA or any other plugin that auto-modifies a file when it becomes writable?"

IntelliJ does this with it's optimize imports feature (see the Optimize Imports on the Fly setting for the Editor config). Although, I don't know if this is really a function of making the file read/only or if it just makes a periodic code sweep and changes it if it can. When I tested it, it took about 5 seconds to remove an unnecessary import from my code after I checked it out from within the IDE.

0

Please sign in to leave a comment.