FlexPMD and TextMate setup question: Creating rules - apache-flex

I wanted to get some assistance into how to set up new rulesets for Textmate, as I can't find the pmd.xml file that needs to be modified.
Thanks in advance

I couldn't find a default pmd.xml file anywhere, so I just used the Adobe Flex PMD Ruleset creator and then exported the default set of rules.
[edited to add]
My project was running using ANT and Hudson so I just put it in the root of that.
However, to properly test this out using TextMate I copied my project to match the following documented conditions:
"The bundle is currently experimental, as such it expects the following:
Source files to be in a saved TextMate project.
ActionScript and MXML source files to be in a directory named 'src'"
I then copied my pmd config file into the project root, opened it, and ran the FlexPMD 'Project' option.
This gave the illusion of using my file, so I renamed the file and deleted all but one rule to prove it wasn't being used.
The TextMate FlexPMD bundle documentation mentions:
To specify a custom ruleset specify it's path using the env var TM_FLEXPMD_RULESET.
So I rather than create a global variable which would affect all projects, I created a project dependent variable by:
The way to do this is currently a little secret but if you deselect everything in the project drawer, then click the info (circled I) button, a panel will appear where you can set variables.
So my variable was TM_FLEXPMD_RULESET with the value pmd_rules.xml
When I then ran the FlexPMD 'Project' option, only one rule was being run.

Related

How to make Qt Creator use variables in the builddir path, so I can easily rename project?

In Qt Creator, in Tools -> Options -> Build & Run -> General -> Build and Run -> Default build directory I have this value:
../build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}
This works but on project creation the variables in that string get replaced with their values, which means that if I later rename the project, I need to go through all of [Debug, Profile, Release] modes and manually change the builddir's path so it reflects the new project name.
So I want:
A way to use variables like %{CurrentProject:Name} in the project settings
(less important) A way to have Qt Creator automatically put references to such variables in the project settings on project creation, so I don't have to adjust them on project creation
Alternatively: Some other pain-free way to rename my project without having to update so many places
Note: I could remove the project-name part from the builddir template, and put the builddir in "." (project dir) rather than in ".." (parent of project dir), that way it would work and there would be no name collisions (MS Visual Studio does it this way), but unfortunately qmake has a limitation (see tobias.hunger's post) that makes it sometimes break unless the project dir is at "the same level" as the builddir.
You'll need to implement this feature yourself. This happens so rarely that until now nobody really needed it. A workaround, if your build/run environment isn't customized, is to remove all kits from the project and re-add the desired kits. It will then create build folders using appropriate names.
But it seems like much ado about nothing: Qt Creator's build folder names might as well be random strings, you should not need to manually refer to them. For product deployment, you'd be using some sort of a CI system, or a manually invoked build script that stages the deliverable(s) (e.g. installer or disk image) where they belong.

Qt Creator Beautifier and different projects

We would like to associate different kind of styles to different projects. I have been looking for and Qt Creator in its new version (4) has the possibility to autoformat files on saving using Beautifier.
My Question is if there is any way to associate for example a style file to one project to be opened when we open that project.
That file would be in the root folder of the project and would be downloaded automatically from the repository.
Looking at the 'Beautifier' options, I see that 'Artistic Style' and 'Uncrustify' has an option to use a file from the project directory as the style file. It's up to you to create these files for each project.
Update for clangformat: If you select the "File" option from the "Predefined Styles" list, clang-format should use a file from the project directory. For more info see the description for -style argument here.

Preview Failed - Visual Studio will look for typescript files when publishing even when they are not included

I'd like to do the inverse of this question/answer:
How to include TypeScript files when publishing?
The thing is that I'm trying to publish an ASP.NET MVC 5 Project. Unfortunately the dreaded Visual Studio and the hungry Jack Typescript interpreter ignores any tsconfig.json file and decides to go deep down and look for any .ts file that is not accompanied by a .js. I have lots of npm packages nested down and some of them have uncompiled typescript files.
Funny thing is, that they are not included in the project (not even an exclamation mark). (I even checked for the .csproj and no files were found).
Is this a bug? How can I prevent this from happening? Using VS 2015.2 (Update 2).
I had a very similar issue. Publish kept failing because it couldn't find foo.js as it wasn't in the same directory as my ts/tsconfig files, even though outDir was set to another location. I don't know if it is a bug or not but I couldn't figure it out using the tsconfig. Instead, I was able to get things working by using the inbuilt TypeScript Build settings instead.
First, I deleted all tsconfig files from my project (I made sure I kept a backup just in case). The TypeScript Build was originally greyed out because I had the tsconfig files in my project.
Next, I created a new folder directly under Scripts to save the js files into.
I then went to Project Properties and selected the TypeScript Build tab. Under Output, I checked the Redirect JavaScript output to directory and browsed to the newly created folder. I repeated this for all build configurations.
Finally, I included the new folder in my project and then built. Folders and files which aren't included in the project can be seen as a ghost icon in the Solution Explorer if you have Show All Files icon selected. I think that if you have multiple TypeScript projects with their own tsconfigs, the file structures are replicated under the chosen output directory but I haven't tested it in many cases so I'm not certain.
Obviously I had to redirect my script bundles to the newly created js structure.
When I first followed this process, I got a few build errors mainly due to my own daft mistakes in my TypeScript code which I'd set the tsconfig to conveniently ignore. Another error was multiple references for objects, which I managed to fix by deleting the definitions files and making sure that the Generate declaration files option was unchecked in Typescript Build. Once I fixed those issues though, I was able to publish without that annoying error - happy days!

Configuring *all* JSHint settings in WebStorm IDE

After a somewhat comprehensive evaluation of IDEs for use in front end development, WebStorm leads the pack I think.
The one missing piece is that we can't configure JSHint the way we need to. The WebStorm preferences GUI provides some options, but not the full set. The GUI only lets you configure 15 of the 30 or so actual available options.
This is a problem because we don't want to change our coding practices just because an IDE doesn't let us configure linting the way we want.
Is there a hacky way to go in and adjust the JSHint library behind the scenes for WebStorm?
You can configure all the options you'd like in a .jshintrc file located in the root directory of your project. This will be a project-wide setting.
From https://www.jetbrains.com/webstorm/webhelp/jshint.html:
Use config files
Select this check box to have the code verified according to the settings from a configuration file. A configuration file is a JSON file with the extension .jshintrc that specifies which JSHint options should be enabled or disabled. WebStorm will look for a .jshintrc file in the working directory. If the search fails, WebStorm will search in the parent folder, then again in the parent folder. The process is repeated until WebStorm finds a .jshintrc or reaches the project root. To have WebStorm still run verification in this case, specify the default configuration file to use.
I've been using this for a while and it works great. Plus you can commit it to your repo and ensure the entire team follows the same code style. Also a great place to add globals.
I'm not aware of any hacky way to do it, but you can vote for the existing feature request.
There's a per-file solution that works, but is not ideal. Would prefer an IDE or project-wide fix/hack.
Set JSHint options at the top of your file:
/*jshint laxcomma:true, asi:true */

How Can I Stop the Enterprise Library Configuration Tool from Inserting an Absolute Path in the Environment Configuration File field?

I'm trying to learn/use the Enterprise Library 5.0 Configuration tool and it seems like it would work perfectly with a few minor exceptions. The problem I am currently having is when it comes to working with different environments. We have 3 environments for one of our web sites, so I can create the 3 different environments within the configuration tool and I can set up the delta files and which properties to overwrite and when.
All is well until I Export Merged Environment Configuration File. When I do this, it creates the file as intended, however it changes the Environment Configuration File field to now include the absolute path.
Also, the delta file now contains a reference to the absolute path.
We use source control (VSTS) - so absolute paths are no good. Our build process consists of creating branches and then merging the code back into a root. We can't have absolute paths when the branches are created by different team members having their code in a different local folder structure.
Is there any way to stop the absolute path from automatically being added? Or any other suggestions?
My research indicates that there does not seem to be a way to make the GUI tool not override the Environment Configuration File value. The solution I am going with is to use the command line tool provided when installing the Enterprise Library. The command line tool is MergeConfiguration.exe.

Resources