Skip to content

Commit

Permalink
Trim trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 2, 2014
1 parent e1f3d44 commit 7efbcd3
Show file tree
Hide file tree
Showing 54 changed files with 247 additions and 247 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
- fix passing of strict maths option

# 1.4.0 Beta 4

2013-05-04

- change strictMaths to strictMath. Enable this with --strict-math=on in lessc and strictMath:true in JavaScript.
Expand Down Expand Up @@ -168,7 +168,7 @@
- significant bug fixes to our debug options
- other parameters can be used as defaults in mixins e.g. .a(@a, @b:@a)
- an error is shown if properties are used outside of a ruleset
- added extract function which picks a value out of a list, e.g. extract(12 13 14, 3) => 14
- added extract function which picks a value out of a list, e.g. extract(12 13 14, 3) => 14
- added luma, hsvhue, hsvsaturation, hsvvalue functions
- added pow, pi, mod, tan, sin, cos, atan, asin, acos and sqrt math functions
- added convert function, e.g. convert(1rad, deg) => value in degrees
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Contributing to Less.js

> We welcome feature requests and bug reports. Please read these guidelines before submitting one.
> We welcome feature requests and bug reports. Please read these guidelines before submitting one.

<span class="warning">**Words that begin with the at sign (`@`) must be wrapped in backticks!** </span>. As a courtesy to avoid sending notifications to any user that might have the `@username` being referenced, please remember that GitHub usernames also start with the at sign. If you don't wrap them in backticks, users will get unintended notifications from you.

GitHub has other great markdown features as well, [go here to learn more about them](https://help.github.com/articles/github-flavored-markdown).
GitHub has other great markdown features as well, [go here to learn more about them](https://help.github.com/articles/github-flavored-markdown).


## Reporting Issues

We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Less.js core. Please read the following guidelines before opening any issue.
We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Less.js core. Please read the following guidelines before opening any issue.

1. **Search for existing issues.** We get a lot of duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.
2. **Create an isolated and reproducible test case.** Be sure the problem exists in Less.js's code with [reduced test cases](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report.
3. **Test with the latest version**. We get a lot of issues that could be resolved by updating your version of Less.js.
3. **Include a live example.** Please use [less2css.org](http://less2css.org/) for sharing your isolated test cases.
3. **Test with the latest version**. We get a lot of issues that could be resolved by updating your version of Less.js.
3. **Include a live example.** Please use [less2css.org](http://less2css.org/) for sharing your isolated test cases.
4. **Share as much information as possible.** Include operating system and version. Describe how you use Less. If you use it in the browser, please include browser and version, and the version of Less.js you're using. Let us know if you're using the command line (`lessc`) or an external tool. And try to include steps to reproduce the bug.
5. If you have a solution or suggestion for how to fix the bug you're reporting, please include it, or make a pull request - don't assume the maintainers know how to fix it just because you do.

Expand All @@ -32,15 +32,15 @@ Please report documentation issues in [the documentation project](https://github

_Pull requests are encouraged!_

* Start by adding a feature request to get feedback and see how your idea is received.
* Start by adding a feature request to get feedback and see how your idea is received.
* If your pull request solves an existing issue, but it's different in some way, _please create a new issue_ and make sure to discuss it with the core contributors. Otherwise you risk your hard work being rejected.
* Do not change the **./dist/** folder, we do this when releasing
* _Please add tests_ for your work. Tests are invoked using `grunt test` command. It will run both node.js tests and browser ([PhantomJS](http://phantomjs.org/)) tests.
* _Please add tests_ for your work. Tests are invoked using `grunt test` command. It will run both node.js tests and browser ([PhantomJS](http://phantomjs.org/)) tests.

### Coding Standards

* Always use spaces, never tabs
* End lines in semi-colons.
* End lines in semi-colons.
* Loosely aim towards jsHint standards


Expand Down
18 changes: 9 additions & 9 deletions benchmark/benchmark.less
Original file line number Diff line number Diff line change
Expand Up @@ -2080,9 +2080,9 @@ div.panel {
*/

/*
/*
* Comment Test
*
*
* - cloudhead (http://cloudhead.net)
*
*/
Expand All @@ -2105,7 +2105,7 @@ div.panel {
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
Expand Down Expand Up @@ -2844,9 +2844,9 @@ td, input {
*/

/*
/*
* Comment Test
*
*
* - cloudhead (http://cloudhead.net)
*
*/
Expand All @@ -2869,7 +2869,7 @@ td, input {
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
Expand Down Expand Up @@ -3608,9 +3608,9 @@ td, input {
*/

/*
/*
* Comment Test
*
*
* - cloudhead (http://cloudhead.net)
*
*/
Expand All @@ -3633,7 +3633,7 @@ td, input {
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
Expand Down
28 changes: 14 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ task clean << {
}

class SourceMapRhinoTest extends RhinoTest {

// helper to get the output map file
def getOutputMap(lessFile) {
def outFile = project.file(lessFile.path.replace('test/less', project.testOut).replace('.less', '.css'))
return project.file(outFile.path + ".map");
}

// callback to add SourceMap options to the options list
def postProcessOptions(options, lessFile) {
def outFile = getOutputMap(lessFile)
Expand All @@ -141,14 +141,14 @@ class SourceMapRhinoTest extends RhinoTest {

options
}

// Callback to validate output
def handleResult(exec, out, lessFile) {
def actualFile = getOutputMap(lessFile)
def expectedFile = project.file(projectDir + fs + "test" + fs + testDir + fs + lessFile.name.replace(".less", ".json"))
def expectedFile = project.file(projectDir + fs + "test" + fs + testDir + fs + lessFile.name.replace(".less", ".json"))
assert actualFile.text == expectedFile.text
}

}

class DebugRhinoTest extends RhinoTest {
Expand All @@ -159,11 +159,11 @@ class DebugRhinoTest extends RhinoTest {

def globalReplacements(input, directory) {
def pDirectory = toPlatformFs(directory)
def p = lessRootDir + fs + pDirectory
def p = lessRootDir + fs + pDirectory
def pathimport = p + toPlatformFs("import/")
def pathesc = escapeIt(p)
def pathimportesc = escapeIt(pathimport)

def result = input.replace("{path}", p).replace("{pathesc}", pathesc).replace("{pathimport}", pathimport)
return result.replace("{pathimportesc}", pathimportesc).replace("\r\n", "\n")
}
Expand All @@ -182,16 +182,16 @@ class RhinoTest extends DefaultTask {
def fs = File.separator;
def projectDir = toUpperCaseDriveLetter(System.getProperty("user.dir"));
def lessRootDir = projectDir + fs + "test" + fs + "less"

def toUpperCaseDriveLetter(path) {
if (path.charAt(1)==':' && path.charAt(2)=='\\') {
return path.substring(0,1).toUpperCase() + path.substring(1);
}
}
return path;
}

def toPlatformFs(path) {
return path.replace('\\', fs).replace('/', fs);
return path.replace('\\', fs).replace('/', fs);
}

def expectedCssPath(lessFilePath) {
Expand All @@ -216,12 +216,12 @@ class RhinoTest extends DefaultTask {
return '\033[' + styles[style][0] + 'm' + str +
'\033[' + styles[style][1] + 'm';
}

// Callback for subclasses to make any changes to the options
def postProcessOptions(options, lessFile) {
options
}

// Callback to validate output
def handleResult(exec, out, lessFile) {
def actual = out.toString().trim()
Expand Down Expand Up @@ -273,7 +273,7 @@ class RhinoTest extends DefaultTask {
standardOutput = out
ignoreExitValue = true
}
println "rhinoTestSrc: ${project.rhinoTestSrc}"
println "rhinoTestSrc: ${project.rhinoTestSrc}"
try {
def exec = project.javaexec(execOptions)
handleResult(exec, out, lessFile)
Expand Down Expand Up @@ -333,7 +333,7 @@ class GruntTask extends Exec {
private String gruntExecutable = Os.isFamily(Os.FAMILY_WINDOWS) ? "grunt.cmd" : "grunt"
private String switches = "--no-color"

String gruntArgs = ""
String gruntArgs = ""

public GruntTask() {
super()
Expand Down
2 changes: 1 addition & 1 deletion build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ tree:
- <%= build.lib %>/tree/url.js
- <%= build.lib %>/tree/value.js
- <%= build.lib %>/tree/variable.js

# =================================
# source-map build
# =================================
Expand Down
6 changes: 3 additions & 3 deletions build/rhino-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
} else if (part === '' && result.length > 0) {
// skip
} else if (part !== '.') {
if (part.slice(-1)==='\\' || part.slice(-1)==='/') {
part = part.slice(0, -1);
}
if (part.slice(-1)==='\\' || part.slice(-1)==='/') {
part = part.slice(0, -1);
}
result.push(part);
}
}
Expand Down
40 changes: 20 additions & 20 deletions lib/less/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ tree.functions = {
continue;
}
currentUnified = current.unit.toString() === "" && unitClone !== undefined ? new(tree.Dimension)(current.value, unitClone).unify() : current.unify();
unit = currentUnified.unit.toString() === "" && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
unit = currentUnified.unit.toString() === "" && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
unitStatic = unit !== "" && unitStatic === undefined || unit !== "" && order[0].unify().unit.toString() === "" ? unit : unitStatic;
unitClone = unit !== "" && unitClone === undefined ? current.unit.toString() : unitClone;
j = values[""] !== undefined && unit !== "" && unit === unitStatic ? values[""] : values[unit];
Expand Down Expand Up @@ -392,12 +392,12 @@ tree.functions = {
},
shade: function(color, amount) {
return this.mix(this.rgb(0, 0, 0), color, amount);
},
},
extract: function(values, index) {
index = index.value - 1; // (1-based index)
index = index.value - 1; // (1-based index)
// handle non-array values as an array of length 1
// return 'undefined' if index is invalid
return Array.isArray(values.value)
return Array.isArray(values.value)
? values.value[index] : Array(values)[index];
},
length: function(values) {
Expand Down Expand Up @@ -583,15 +583,15 @@ tree._mime = {

var mathFunctions = {
// name, unit
ceil: null,
floor: null,
sqrt: null,
ceil: null,
floor: null,
sqrt: null,
abs: null,
tan: "",
sin: "",
tan: "",
sin: "",
cos: "",
atan: "rad",
asin: "rad",
atan: "rad",
asin: "rad",
acos: "rad"
};

Expand All @@ -616,19 +616,19 @@ function colorBlend(mode, color1, color2) {
var ab = color1.alpha, cb, // backdrop
as = color2.alpha, cs, // source
ar, cr, r = []; // result

ar = as + ab * (1 - as);
for (var i = 0; i < 3; i++) {
cb = color1.rgb[i] / 255;
cs = color2.rgb[i] / 255;
cr = mode(cb, cs);
if (ar) {
cr = (as * cs + ab * (cb
cr = (as * cs + ab * (cb
- as * (cb + cs - cr))) / ar;
}
r[i] = cr * 255;
}

return new(tree.Color)(r, ar);
}

Expand All @@ -638,7 +638,7 @@ var colorBlendMode = {
},
screen: function(cb, cs) {
return cb + cs - cb * cs;
},
},
overlay: function(cb, cs) {
cb *= 2;
return (cb <= 1)
Expand All @@ -651,7 +651,7 @@ var colorBlendMode = {
e = 1;
d = (cb > 0.25) ? Math.sqrt(cb)
: ((16 * cb - 12) * cb + 4) * cb;
}
}
return cb - (1 - 2 * cs) * e * (d - cb);
},
hardlight: function(cb, cs) {
Expand Down Expand Up @@ -698,25 +698,25 @@ tree.defaultFunc = {

function initFunctions() {
var f, tf = tree.functions;

// math
for (f in mathFunctions) {
if (mathFunctions.hasOwnProperty(f)) {
tf[f] = _math.bind(null, Math[f], mathFunctions[f]);
}
}

// color blending
for (f in colorBlendMode) {
if (colorBlendMode.hasOwnProperty(f)) {
tf[f] = colorBlend.bind(null, colorBlendMode[f]);
}
}

// default
f = tree.defaultFunc;
tf["default"] = f.eval.bind(f);

} initFunctions();

function hsla(color) {
Expand Down
6 changes: 3 additions & 3 deletions lib/less/import-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
var importVisitor = this,
evaldImportNode,
inlineCSS = importNode.options.inline;

if (!importNode.css || inlineCSS) {

try {
Expand All @@ -63,7 +63,7 @@
this._importer.push(importNode.getPath(), importNode.currentFileInfo, importNode.options, function (e, root, importedAtRoot, fullPath) {
if (e && !e.filename) { e.index = importNode.index; e.filename = importNode.currentFileInfo.filename; }

if (!env.importMultiple) {
if (!env.importMultiple) {
if (importedAtRoot) {
importNode.skip = true;
} else {
Expand All @@ -73,7 +73,7 @@
}
importVisitor.onceFileDetectionMap[fullPath] = true;
return false;
};
};
}
}

Expand Down
Loading

0 comments on commit 7efbcd3

Please sign in to comment.