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

Provide some rules around naming of variables and methods #109

Merged
merged 25 commits into from
Oct 21, 2015
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9538eca
work in progress on checking variable names
justinmclean Oct 5, 2015
fa0c959
Merge branch 'dev' into naming
justinmclean Oct 16, 2015
d7ed91a
Add more tests
justinmclean Oct 16, 2015
7089da7
Add variable name checker to flint definitions
justinmclean Oct 16, 2015
8b2e634
use expression method rather than element
justinmclean Oct 16, 2015
be6ddbe
fix line number calculation where it pure script with no tags.
justinmclean Oct 16, 2015
05ea8ad
remove debug
justinmclean Oct 16, 2015
030b9a4
Add tests for scripts blocks
justinmclean Oct 16, 2015
e86dff3
used more of the built into component, less decompile and string
ryaneberly Oct 16, 2015
fa23dd2
Added parameters change default form warning to info
justinmclean Oct 18, 2015
985c619
Moved code to checking if a name is valid to it's own class
justinmclean Oct 18, 2015
c16745b
Moved code to checking if a name is valid to it's own class
justinmclean Oct 18, 2015
8e72adc
rearrange a little to group properties to rules
justinmclean Oct 18, 2015
f09f42e
Fix function name not being set
justinmclean Oct 18, 2015
18b228f
Made code a bit more generic and renamed variable to name. Add defaul…
justinmclean Oct 18, 2015
0b5455a
Rules for method names
justinmclean Oct 18, 2015
0441720
fix parameter setting code
justinmclean Oct 18, 2015
902859a
added method name rules
justinmclean Oct 18, 2015
402d2bb
no need to set parameter twice
justinmclean Oct 18, 2015
9c4c2fc
Added rules for method names
justinmclean Oct 18, 2015
da9cd4d
Merge remote-tracking branch 'origin/dev' into naming
ryaneberly Oct 19, 2015
36b33e2
Tests for valid names
justinmclean Oct 20, 2015
536346e
improve regular expressions and fix up word count
justinmclean Oct 20, 2015
84e5241
Add JSON config for variable and method names
justinmclean Oct 20, 2015
0aa29d5
Merge branch 'dev' into naming
justinmclean Oct 21, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -56,10 +56,7 @@ else if (expression instanceof CFIdentifier) {
}

public void checkNameForBugs(String variable, String filename, int line, BugList bugs) {
System.out.println("Var:" + variable);

if (isInvalid(variable)) {
System.out.println("isInvalid : " + variable);
bugs.add(new BugInfo.BugInfoBuilder().setLine(line).setMessageCode("VAR_INVALID_NAME")
.setSeverity(severity).setFilename(filename)
.setMessage("Variable " + variable + " is not a valid name. Please use CamelCase or underscores.")
@@ -96,7 +93,6 @@ public void checkNameForBugs(String variable, String filename, int line, BugList
.build());
}
if (hasPrefixOrPostfix(variable)) {
System.out.println("hasPrefixOrPostfix : " + variable);
bugs.add(new BugInfo.BugInfoBuilder().setLine(line).setMessageCode("VAR_HAS_PREFIX_OR_POSTFIX")
.setSeverity(severity).setFilename(filename)
.setMessage("Variable has prefix or postfix " + variable + " and could be named better.")