Skip to content

Commit 96651fe

Browse files
author
duaraghav8
committed
max-len default limit 79 -> 145
1 parent 7eef233 commit 96651fe

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

docs/user-guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ For eg- your choice of indentation might be Tab or 4 spaces or 2 spaces. What in
369369
+----------------------------+--------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------+-------+
370370
| no-experimental | Ensure that experimental features are not used in production | - | | |
371371
+----------------------------+--------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------+-------+
372-
| max-len | Ensure that a line of code doesn't exceed the specified number of characters | Single integer representing the number of characters to allow per line of code | 79 | |
372+
| max-len | Ensure that a line of code doesn't exceed the specified number of characters | Single integer representing the number of characters to allow per line of code | 145 | |
373373
+----------------------------+--------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------+-------+
374374

375375
.. index:: IDE and Editor integrations

lib/rules/max-len.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
},
2222

2323
create(context) {
24-
const maxLineLength = context.options ? context.options [0] : 79;
24+
const maxLineLength = context.options ? context.options [0] : 145;
2525
const sourceCode = context.getSourceCode();
2626

2727
function inspectProgram(emitted) {

test/lib/rules/max-len/max-len.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const Solium = require("../../../../lib/solium"),
99
wrappers = require("../../../utils/wrappers"),
1010
{ addPragma } = wrappers;
11-
const DEFAULT_MAX_ACCEPTABLE_LEN = 79;
11+
const DEFAULT_MAX_ACCEPTABLE_LEN = 145;
1212

1313
function makeString(length, character) {
1414
return new Array(length + 1).join(character);
@@ -27,7 +27,7 @@ describe("[RULE] max-len: default len", function() {
2727

2828
describe("Acceptances", function() {
2929

30-
it("should allow short line", function(done) {
30+
it("should allow line length <= default acceptable", function(done) {
3131
let name = makeString(DEFAULT_MAX_ACCEPTABLE_LEN - "contract {}".length, "a"),
3232
code = `contract ${name} {}`,
3333
errors = Solium.lint(addPragma(code), this.userConfig);
@@ -50,7 +50,7 @@ describe("[RULE] max-len: default len", function() {
5050

5151
describe("Rejections", function() {
5252

53-
it("should reject long line on top level node", function(done) {
53+
it("should reject line length > default acceptable on top level node", function(done) {
5454
let name = makeString(DEFAULT_MAX_ACCEPTABLE_LEN + 1 - "contract {}".length, "a"),
5555
code = `contract ${name} {}`,
5656
errors = Solium.lint(addPragma(code), this.userConfig);
@@ -64,7 +64,7 @@ describe("[RULE] max-len: default len", function() {
6464
done();
6565
});
6666

67-
it("should reject long line on child node", function(done) {
67+
it("should reject line length > default acceptable on child node", function(done) {
6868
let name = makeString(DEFAULT_MAX_ACCEPTABLE_LEN + 1 - " uint ;".length, "a"),
6969
code = (
7070
"contract dummy {\n" +
@@ -83,7 +83,7 @@ describe("[RULE] max-len: default len", function() {
8383
done();
8484
});
8585

86-
it("should reject long line only once", function(done) {
86+
it("should reject line length > default acceptable only once", function(done) {
8787
let name = makeString(DEFAULT_MAX_ACCEPTABLE_LEN + 1 - " uint short;uint ;".length, "a"),
8888
code = (
8989
"contract dummy {\n" +
@@ -107,7 +107,7 @@ describe("[RULE] max-len: default len", function() {
107107
describe("[RULE] max-len: custom len", function() {
108108

109109
before(function(done) {
110-
this.CUSTOM_MAX_ACCEPTABLE_LEN = 99;
110+
this.CUSTOM_MAX_ACCEPTABLE_LEN = 200;
111111
this.userConfig = {
112112
"rules": {
113113
"max-len": ["error", this.CUSTOM_MAX_ACCEPTABLE_LEN]
@@ -118,7 +118,7 @@ describe("[RULE] max-len: custom len", function() {
118118

119119
describe("Acceptances", function() {
120120

121-
it("should allow short line", function(done) {
121+
it("should allow line length <= custom acceptable", function(done) {
122122
let name = makeString(this.CUSTOM_MAX_ACCEPTABLE_LEN - "contract {}".length, "a"),
123123
code = `contract ${name} {}`,
124124
errors = Solium.lint(addPragma(code), this.userConfig);
@@ -141,7 +141,7 @@ describe("[RULE] max-len: custom len", function() {
141141

142142
describe("Rejections", function() {
143143

144-
it("should reject long line on top level node", function(done) {
144+
it("should reject line length > custom acceptable on top level node", function(done) {
145145
let name = makeString(this.CUSTOM_MAX_ACCEPTABLE_LEN + 1 - "contract {}".length, "a"),
146146
code = `contract ${name} {}`,
147147
errors = Solium.lint(addPragma(code), this.userConfig);
@@ -155,7 +155,7 @@ describe("[RULE] max-len: custom len", function() {
155155
done();
156156
});
157157

158-
it("should reject long line on child node", function(done) {
158+
it("should reject line length > custom acceptable on child node", function(done) {
159159
let name = makeString(this.CUSTOM_MAX_ACCEPTABLE_LEN + 1 - " uint ;".length, "a"),
160160
code = (
161161
"contract dummy {\n" +
@@ -174,7 +174,7 @@ describe("[RULE] max-len: custom len", function() {
174174
done();
175175
});
176176

177-
it("should reject long line only once", function(done) {
177+
it("should reject line length > custom acceptable only once", function(done) {
178178
let name = makeString(this.CUSTOM_MAX_ACCEPTABLE_LEN + 1 - " uint short;uint ;".length, "a"),
179179
code = (
180180
"contract dummy {\n" +

test/lib/solium.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ describe("Solium.lint() comment directives", () => {
14611461
errors = Solium.lint(code, config);
14621462

14631463
errors.should.be.Array();
1464-
errors.should.have.size(15);
1464+
errors.should.have.size(14);
14651465

14661466

14671467
code = `
@@ -1480,7 +1480,7 @@ describe("Solium.lint() comment directives", () => {
14801480
errors = Solium.lint(code, config);
14811481

14821482
errors.should.be.Array();
1483-
errors.should.have.size(15);
1483+
errors.should.have.size(13);
14841484

14851485

14861486
code = `
@@ -1499,7 +1499,7 @@ describe("Solium.lint() comment directives", () => {
14991499
errors = Solium.lint(code, config);
15001500

15011501
errors.should.be.Array();
1502-
errors.should.have.size(15);
1502+
errors.should.have.size(13);
15031503

15041504

15051505
code = `
@@ -1518,7 +1518,7 @@ describe("Solium.lint() comment directives", () => {
15181518
errors = Solium.lint(code, config);
15191519

15201520
errors.should.be.Array();
1521-
errors.should.have.size(14);
1521+
errors.should.have.size(13);
15221522

15231523

15241524
code = `
@@ -1627,7 +1627,7 @@ describe("Solium.lint() comment directives", () => {
16271627
errors = Solium.lint(code, config);
16281628

16291629
errors.should.be.Array();
1630-
errors.should.have.size(15);
1630+
errors.should.have.size(14);
16311631

16321632

16331633
code = `
@@ -1646,7 +1646,7 @@ describe("Solium.lint() comment directives", () => {
16461646
errors = Solium.lint(code, config);
16471647

16481648
errors.should.be.Array();
1649-
errors.should.have.size(15);
1649+
errors.should.have.size(13);
16501650

16511651

16521652
code = `
@@ -1665,7 +1665,7 @@ describe("Solium.lint() comment directives", () => {
16651665
errors = Solium.lint(code, config);
16661666

16671667
errors.should.be.Array();
1668-
errors.should.have.size(15);
1668+
errors.should.have.size(14);
16691669

16701670

16711671
code = `
@@ -1684,7 +1684,7 @@ describe("Solium.lint() comment directives", () => {
16841684
errors = Solium.lint(code, config);
16851685

16861686
errors.should.be.Array();
1687-
errors.should.have.size(14);
1687+
errors.should.have.size(13);
16881688

16891689

16901690
code = `

0 commit comments

Comments
 (0)