w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
TypeScript with require.js and jquery does not work on production server (require.js Script Error)
Are you compiling your website in Release mode when you are deploying to your server? In that case you need to add a release version in the project file: <PropertyGroup Condition="'$(Configuration)' == 'Release'"> <TypeScriptSourceMap> --module AMD</TypeScriptSourceMap> </PropertyGroup> <Target Name="BeforeBuild"> <Message Text="Compiling TypeScript files" /> <Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> <Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> </Target> In TypeScript 0.8.2+ the format is: <PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <TypeScr

Categories : Jquery

Check jquery in paths / require.config - Require.js
Please Checkout this http://blog.falafel.com/blogs/basem-emara/2013/03/01/how-to-avoid-loading-jquery-twice-with-requirejs. It might help.

Categories : Javascript

Does Django require an IDE an does ASP.NET require Visual Studio?
The need to recompile your code while using Visual Studio is due to the design of the programming language used - not due to Visual Studio. Java is the same, whether or not you are using NetBeans, Eclipse, or NotePad. An IDE is typically not required, but as you pointed out, it makes life easier. I started out using vim to program in Python - but now use Eclipse. Django comes with built-in command line tools to help you build your initial project, but in theory, you could manually create these files.

Categories : Asp Net

NoClassDefFoundError when checkstyle is running
You can do it like following : Create plugin project and add your custom checks there. Make appropriate changes to plugin.xml, checkstyle_packages.xml. Export the project as Deployable Plug-ins and fragments (Export > Plug-in Developement) Copy the jar file to Eclipse Plugin folde, so no need to install your custom check . You can go through this tutorial for reference To reduce effort, download a Sample Check, the file is here under the name net.sf.eclipsecs.sample Just replace your source in src folder. Before replacing, refer this 3 files in src/net/sf/eclipsecs/sample/checks/ directory as you will need them in your com/onuspride/codetools/checkstyles/ directory : checkstyle-metadata.properties checkstyle-metadata.xml messages.properties After replacing the code, make appro

Categories : Misc

Checkstyle whitespace checking
In Eclipse-CS, you can set a checkmark in Window ▶ Preferences ▶ Checkstyle ▶ Include Rule names in violation messages. Then, for each violation, you can see the rule that caused it. In your case, you have Type Cast enabled in both the Whitespace After and the No Whitespace After rules. You will want to uncheck Type Cast for "Whitespace After" in order to support your formatting. Eclipse-CS will generate the XML for you, but if you must set it manually, you can do so by specifying the tokens to check (example shows how TYPECAST ist left out): <module name="WhitespaceAfter"> <property name="tokens" value="COMMA, SEMI"/> </module>

Categories : Misc

Checkstyle - reports not showing anything
You should add the maven-jxr-plugin to the reporting Plugin section. <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.3</version> </plugin> </plugins> </reporting>

Categories : Jenkins

Maven checkstyle plugin with properties
First i would suggest not to use absolute file names like you do via configLocation. The better solution is to use an artifact which contains the appropriate configuration file like having a separate project let's call it: checkstyle which can be versionized etc. checkstyle |-- src | `-- main | `-- resources | |-- checkstyle.xml | `-- LICENSE.TXT `-- pom.xml <project> <modelVersion>4.0.0</modelVersion> <groupId>com.example.checkstyle</groupId> <artifactId>checkstyle</artifactId> <version>1.0</version> <name>checkstyle configuration</name> </project> After you have made mvn install you can use the configuration like the following: <project> <mode

Categories : Maven

Eclipse java/ant checkstyle issue
which checkstyle should be used/configured in Eclipse? The checkstyle rule LeftCurly defines the placement of left curly braces: eol: The brace must always be on the end of the line. nl: The brace must always be on a new line. nlow: Apply either eol or nl depending on the length of the line. See also the LeftCurly rule in the Block Checks category and the Lcurly property.

Categories : Java

Does Checkstyle provide quickfix possibilities?
Refer to Extending the eclipse-cs plugin page. From there you can download a sample Check. The file is here under the name net.sf.eclipsecs.sample In src etsfeclipsecssamplechecks there is one QuickFix Java code and in base directory, in plugin.xml the following line is present, which enables the quickfix. <!-- This plugin provides custom quickfixes for Checkstyle problems. --> <extension point="net.sf.eclipsecs.ui.checkstyleQuickfixProvider"> </extension> You can download and refer that sample for your query. Extending Check is described nicely there.

Categories : Eclipse

how to configure/use CheckStyle in Hudson/Jenkins
If you've installed the plugin in Jenkins/Hudson, you should now be able to add the checkstyle goal to your project/job. In the goals section of your Jenkins Maven job, add "checkstyle:checkstyle" to enable the checkstyle plugin to analyse your project.

Categories : Maven

Why checkstyle's checks requires compilation?
Checkstyle (or at least some of its rules) needs the compiled classes in addition to the sources. You can prevent passing of the compiled classes (and thus compilation) with tasks.withType(Checkstyle) { classpath = files() }, but it may have negative consequences on the analysis.

Categories : Gradle

Checkstyle check for duplicate classes
This is more difficult to do right than one might think, mostly because Java supports all kinds of nesting, like static classes defined within an interface, anonymous inner classes, and so on. Also, you are extending AbstractFileSetCheck, which is not a TreeWalker module, so you don't get an AST. If you want an AST, extend Check instead. Since "quick and dirty" is an option for you, you could simply deduce the class name from the file name: Determine the canonical path, remove common directories from the beginning of the String, replace slashes with dots, cut off the file extension, and you are more or less there. (Without supporting inner classes etc. of course.) A better solution might be to extend Check and register for PACKAGE_DEF, CLASS_DEF, ANNOTATION_DEF, ENUM_DEF, and INTERFACE_D

Categories : Misc

How to use Checkstyle plugin in Jenkins/Hudson
Posting this as an answer per request: You need to run CheckStyle as part of your build job; Hudson just displays the results from your build. @kumarM, what build framework (Ant, Maven, Gradle etc.) are you using ? I can add more details here based on your answer.

Categories : Jenkins

Customise maven checkstyle plugin
You can see that maven is looking for the snapshot in the wrong repo http://repository.apache.org/snapshots/ Your artifact is in https://oss.sonatype.org/content/repositories/snapshots Either the pom you are using to run is not the one that defines the sonatype <repository> or it is being overwriten. Check the effective pom in the folder where you run maven and find the definition, you will probably find it is apache.org and not sonatype's Alternatively, it is usually not recommended to use <repository> in your poms since it makes the artifacts unusable by others that don't have access to the special repo, check this article. I prefer configuring the custom repo (sonatype snapshots) in settings.xml

Categories : Java

CheckStyle API usage without Check Rules
Well ... Checkstyle isn't really meant to be a toolkit for building third-party static code analysis tools. I would suggest taking a look at the ANTLR project instead. It's a really good Java parser which may already do what you need. Checkstyle uses ANTLR under the hood. You can take a look at how they do it by downloading the Checkstyle sources. This also reveals the logic behind their cyclomatic complexity implementation. However, it is generally possible to use Checkstyle as a framework for something not Checkstyle. You could do that by writing a Checkstyle check, which basically means writing a subclass of Check. Then you can configure Checkstyle to run your class as explained in the link. If you want to simply gather metrics generated by Checkstyle to use in your own application on

Categories : Java

Checkstyle error when not declaring fields as final
The problem is indeed that you are extending Exception. There is a design rule that exception objects should be immutable. All relevant values should be given in the constructor. The checkstyle rule seems to be called MutableException and is documented here.

Categories : Java

Configuring Checkstyle to ignore generic warnings
You can configure this behavior of the JavadocType check by setting the allowMissingParamTags property to true like so: <module name="JavadocType"> <property name="allowMissingParamTags" value="true"/> </module> On my version of the Eclipse checkstyle plugin (5.6.0.201209221626), this option is somehow not present in the GUI (bug?), but it can be set by directly editing the XML.

Categories : Java

ANT checkstyle task: Can't find/access AST Node
I gave up trying to solve this. Changed checkstyle.classpath to <path id="checkstyle.classpath"> <fileset dir="${env.CHECKSTYLE_HOME}"> <include name="*all.jar"/> </fileset> </path> and deleted the antlr.jar in $ANT_HOME/lib, possibly breaking stuff. Still looking for a potential answer though.

Categories : Java

How can I suppress specific checkstyle rules in eclipse?
Your suppression filter file uses the 1.1 syntax, but claims to be using the newer 1.3 syntax. Exchange the header like so: <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> Also, your configuration file must reference the suppression filter. Add a module definition like this (add it before the last closing </module> tag, not under Treewalker): <module name="SuppressionFilter"> <property name="file" value="${workspace_loc}/MyProject/suppressions.xml"/> </module> Using the ${workspace_loc} variable makes sure that this works even when you copy or rename the workspace.

Categories : Misc

checkstyle ant task clickable console entry
Use Eclipse-CS, the Checkstyle Eclipse plugin. This will make Checkstyle warnings appear in Eclipse in the 'Problems' view. There, you can click on the entry and it will take you directly to the corresponding line of code.

Categories : Misc

How to use custom check in checkStyle from eclipse : without maven?
You need eclipse-cs plugin. It integrates checkstyle to eclipse and allows providing custom checks. Also, look at sevntu.checkstyle. It is extension to the eclipse-cs plugin. Sevntu.checkstyle adds many useful checks and allows to append your own checks(see wiki on github). Maybe it contains check that you need.

Categories : Java

Generating Checkstyle Reports (with extended checks)
I have found out the following solution, which is working fine. extract checkstyle-x.x-all.jar copy the extended classes in the extracted directory copy the metadata,message and properties file of extended check in the same directory. if any of the file is alreasy present, then edit the file and add the content from extended checks. create a new .jar file including all these. in ant build.xml <taskdef>, set this .jar as classpath Like, after done till 2nd step, I found checkstyle_packages.xml is already present, so I edit it and added the content from extended one in proper position. Previous Version: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE checkstyle-packages PUBLIC "-//Puppy Crawl//DTD Package Names 1.0//EN" "http://www.puppycrawl.com/dtds/package

Categories : Java

INSTANCE error in Eclipse CheckStyle plugin
It looks like it is a checkstyle 5.6.1 bug: http://sourceforge.net/p/eclipse-cs/bugs/357/ When we upgrade to 5.6.1 in Eclipse 3.6.2 we get the following error in the Checkstyle preference page. When we switch to 5.6.0 it works without errors. java.lang.NoSuchFieldError: org/eclipse/core/runtime/preferences/InstanceScope.INSTANCE at net.sf.eclipsecs.core.CheckstylePluginPrefs.setBoolean(CheckstylePluginPrefs.java:128)

Categories : Java

Checkstyle: Custom Rules - Eclipse Plugin
You already have the correct links that will eventually get you there. As for your questions: All your custom checks can go into one JAR file. That JAR file must be an Eclipse plugin JAR. I simply install it by copying it to the Eclipse dropins folder, but there may be more elegant ways to do that. So you end up with two plugins: The original, unmodified Eclipse-CS, and your own plugin which contains the custom checks. When both are independently installed in Eclipse, the Eclipse-CS configuration dialog will offer your custom checks for use in Checkstyle configurations.

Categories : Eclipse

how to fix illegal package import checkstyle warning
Usually packages that are for internal use and version specific. They can be dropped/modified anytime. Like sun.*. Look for anything that is not by default in your Checkstyle config. Reference.

Categories : Java

Workaround to "allowThrowsTagsForSubclasses" issue in Eclipse Checkstyle Plug-in
You could allow subclass throws in Checkstyle: <module name="RedundantThrows"> <property name="allowSubclasses" value="true"/> </module> and change your method signature to: public void myMethod() throws SubclassOfMyException, MyException { Some may consider it bad code style, though.

Categories : Java

Exporting Jenkin's Checkstyle graphical report to HTML
You can do something like this with the Send build artifacts over SSH (if your backup location is Unix). Look at the documentation for the plugin here: https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin As far as where Jenkins stores the report files that depends on where you configured your build script to send them. Ant has the toFile attribute. If you use Maven it uses the outputDirectory parameter.

Categories : Jenkins

Java Checkstyle severity level inherit meaning?
Command line properties and ant Checkstyle task properties apply to the root Checker module. Also, properties are inherited in the module hierarchy. See Checkstyle documentation for further details.

Categories : Java

Checkstyle plugin incorrectly examines resource files
This is a known issue with the 2.10 version of the maven-checkstyle plugin. See the comments here: https://jira.codehaus.org/browse/MCHECKSTYLE-184 You can either downgrade to version 2.9.1 or wait until they fix the configuration of this in a newer version.

Categories : Java

Is there any way to enforce enum types naming convention with Checkstyle?
As far as i know there is not. But you can define your own rule. See http://checkstyle.sourceforge.net/writingchecks.html

Categories : Java

Making GWT JSNI code legal to Checkstyle's TrailingComment metric
It seems to me that the legalComment pattern is not applied to multiline comments. So you must solve your problem in the format property. One way of doing that would be to allow trailing comments for native methods, like so: <module name="TrailingComment"> <property name="format" value="^(?:.+?native.+?|[s});]*)$"/> </module>

Categories : Java

How to integrate checkstyle and PMD into Play framework Build.scala file
I've created a GitHub repo that answers your question. You can start with that project, or manually follow these steps to adapt my giter8 template to Play: First make a new Play project with play new foo, choosing 2 for Java. Put the template's pmd-ruleset.xml and checkstyle-config.xml in the Play project directory. Copy the object ProjectSettings from the template's project/build.scala into Play's project/Build.scala. Add the contents of the template's project/plugins.sbt to Play's project/plugins.sbt, remembering to leave a blank line before you paste. Last, change the Play project/build.scala to actually use ProjectSettings.all from the template: val main = play.Project(appName, appVersion, appDependencies).settings( ProjectSettings.all: _* )

Categories : Scala

Sonar global Java Checkstyle parameters overrides profile
@Matthieu, this is definitely due to a bad usage of this General Settings > Java > Checkstyle > sonar.checkstyle.filters property which must be used only to activate one of those three following filters : SuppressionCommentFilter, SuppressWithNearbyCommentFilter and SuppressionFilter.

Categories : Java

Gradle PMD Checkstyle Findbugs - Which sourceSet directory to work Java build
The following did the trick for all issues except B(Question 2) i.e. added a sourceSets line and told those 3 tools (pmd/checkstyle/findbugs) to see only main (source code which is "src/java") under sourceSets definition. By the way, I took the "sourceSets" section and defined it before the following lines as well. checkstyle { configFile = new File(rootDir, "config/checkstyle.xml") ignoreFailures = true sourceSets = [sourceSets.main] } findbugs { ignoreFailures = true sourceSets = [sourceSets.main] } pmd { ruleSets = ["basic", "braces", "design"] ignoreFailures = true sourceSets = [sourceSets.main] }

Categories : Gradle

Get Android gradle plugin & checkstyle working together / command line usage
Someone has a great answer to solve integrating PMD, findbugs and checkstyle with Gradle for Android. Unfortunately, the only solution for now is based on ant : http://sethrylan.org/2013/07/14/gradle-android-findbugs.html I wish gradle will one day allow to do as much as maven for Android. --- Update as of October 2013 With Gradle 1.8 and Android plugin for Gradle 0.6.+, you don't need this anymore. Android sourcesets and configurations are now compatible with the java plugin and all quality plugin work out of the box. This includes pmd, findbugs, checkstyle and classycle. --- Update A configuration, largely inspired from the project mentioned above, is proposed in this open source project as well, plus other tools.

Categories : Android

maven-checkstyle-plugin: Unable to parse suppressions.xml - invalid formats or checks format
The files attribute is a regular expression which is evaluated against the absolute file paths of the files checked. So the ** expression is invalid. Use something like this instead: <?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> <suppressions> <suppress checks="JavadocPackage" files="[/\]src[/\]test[/\]java[/\].*"/> </suppressions> Using [/\] instead of just / also supports both UNIX and Windows path separators.

Categories : Eclipse

In need of a different obj-c indentation (Emacs)
You may change the indentation of the different syntactic elements by calling c-set-offset. If you call it interactively, emacs will tell you the value of the "indentation variable" you want to change, and will ask you for a value. Programatically, this would do something close to what you want in the example you mention, but you may have many other use cases where you want another behavior: (c-set-offset 'arglist-intro '+) (c-set-offset 'arglist-close 0) (c-set-offset 'objc-method-call-cont 'c-lineup-argcont)

Categories : Objective C

Set QTreeWidget indentation per row
I don't know either how to do that, but perhaps you can use an HTML code to insert a blank space in front of your items. http://www.computerhope.com/issues/ch001034.htm

Categories : C++

C indentation tool
Since you plan on extending existing code, why not use astyle? Once you have the correct flags it formats your code accordingly so that the results will always be the same. I (sadly) haven't found any dry-run flags, but a diff of your original file and the newly created astyle file should give you all violations.

Categories : C

Indentation instead of brackets for Antlr4
What about official GitHub ANTLR4 grammar repository? You can find many common language grammars. There is even a python3 directory containing Python3.g4. This should help you out.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.