officient / readable Goto Github PK
View Code? Open in Web Editor NEWA static analysis tool for PHP with a focus on code readability
License: GNU General Public License v3.0
A static analysis tool for PHP with a focus on code readability
License: GNU General Public License v3.0
Example:
<?php
function doSomething(?string $param): string {
// ...
}
The ternary-max-length rule will fail because the function line has a ?
followed by a :
.
Starting a new project with blank rules as below
{
"pathes": [
"src/"
],
"rules": {}
}
I think the expected output is that the test will pass. As there is no configuration here that it should extend or include a base config file.
Removing a rule that is now in the default would mean having to set that rule manually to "false". This might be possible but it will cause issues if we add rules in the future, as package users would require to keep up with new rules at every upgrade in orde to disable them.
tokens.current()
for file-max-size is { body: '', type: 9 }
here:
readable/src/rules/file-max-size.js
Line 25 in 47980bf
making at line ${token.line} column ${token.column}
result in at line undefined column undefined.
Maybe just remove the line/column comment in case of file-max-size as it doesn't have a specific ln/col?
eg --help could explain how to save a new baseline,..
for file-max-size
, we can do this:
"file-max-size": {
"max-lines": 200,
"include-comments": false,
"include-empty-lines": false
},
if we do this for function-max-size
this doesn't work.
Would it be possible to add this functionality as well? (to avoid including comments/empty lines)
Thanks! :)
this is seen as 24 (as it takes the first 4 spaces into account)
$abc = $def ? 1 : 0;
'exclude_paths' should overrule 'paths'
e.g.
{
"baseline": ".readable-baseline.json",
"paths": [
"server/"
],
"exclude_paths": [
"server/dir_to_be_excluded/"
]
}
Currently, when there's a function with multiple (long) parameters, we write them all on 1 line, because otherwise it would count for the file-max-size
-limit we have. Example:
public function testFunction($one, $two, $three, $four, $five, $six, $seven, $eight, $nine, $ten)
{
}
As you can see, this counts as 3 lines.
What we would like to have is this:
public function testFunction(
$one,
$two,
$three,
$four,
$five,
$six,
$seven,
$eight,
$nine,
$ten
) {
}
And still have it count as 3 lines instead of 13
Would that be possible to have an option to handle this?
Thanks!
$a = '';
// some comment
$b = '';
It would be better if this was seen as 2 lines instead of 4
Pros:
Cons:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.