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

can tracable variable #124

Closed
wants to merge 1 commit into from
Closed

Conversation

danny007in
Copy link

@danny007in danny007in commented Jan 29, 2021

  • Unused variables are grouped per files.
  • displayed with line and column

Highly helped by this PR #123

Co-Authored-By: Georg Gentzen [email protected]

@gentzeng
Copy link

The variable $nestedVar belongs to test.scss

issue

@gentzeng
Copy link

gentzeng commented Jan 30, 2021

@danny007in Is there any way to contact you privately? (Before you fix the earlier mentioned bug ;) )

gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

co-authored by [email protected]

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
@danny007in
Copy link
Author

@danny007in Is there any way to contact you privately? (Before you fix the earlier mentioned bug ;) )

You can discuss here, so every can see wants going on this PR

gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

Co-authored-by danny007in [email protected]

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

Co-authored-by: danny007in [email protected]

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

Co-authored-by: danny007in
<[email protected]>

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

Co-Authored-By: danny007in <[email protected]>

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

Co-Authored-By: Daniel <[email protected]>

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Co-Authored-By: Daniel <[email protected]>

Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 30, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
@gentzeng
Copy link

I like your Idea. However, if see it right, it introduces a quadratic runtime for setting the file paths. I incorporated your approach into PR #125 without that overhead, shrinked the code since your approach allows that and adjusted the results to be backwards compatible to not introduce a breaking change. Furthermore, I plan issue another pull request that is based on the current one.

Thanks for your valuable help :D

@gentzeng
Copy link

For example, its easier to set the file path for each variable for creating reports in files, since, e.g., the SonarQube generic issues format requires that.

Breaking Change

Co-Authored-By: Georg Gentzen <[email protected]>
Comment on lines +53 to +57
variables.forEach(sassVar => {
if (sassVar.filePath === '') {
sassVar.filePath = file;
}
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is introducing quadratic overhead and is hence inefficient. Just add the filename with the parse function in line 51 as I did in PR #125

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore, as written above, its easier to set the file path for each variable for creating reports in files, since, e.g., the SonarQube generic issues format requires that.

@gentzeng
Copy link

This is not a breaking change anymore. However, the Readme needs to be updated. You can find a version in PR #125, so you can save some time.

@danny007in danny007in closed this Jan 31, 2021
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 31, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 31, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Jan 31, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Feb 2, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Feb 17, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Mar 3, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Mar 3, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Mar 3, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Mar 3, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
gentzeng added a commit to gentzeng/find-unused-sass-variables that referenced this pull request Mar 3, 2021
Unused variables are grouped per containig files and displayed with line
and column information. Files are displayed relatively to working
directory. In addition to total amount of variables, amount of unused
variables gets also displayed.

fix(app.js): Fixed file according to xo linting rules

feat: print enhanced information of unused variable

line and column of unused variable with respect to all files of one
regarded directory, i.e., within concatenation of all those files, are
printed

fix: line Info of variable now gets displayed per containing file

fix: unused variables are grouped per containing file

feat: display path of files containing unused variables relatively

fix: added newline  before files containing UVs are displayed

stlye(cli.js): put console.log command on more lines

refactor(index.js): refactored calculation of variable Lines per File

fix(cli.js): exchanged manual ansi escape code with chalk command

fix: Deleted wrongfully copied directory

fix(README.md): Updated README.md

fix(): incorporated ideas from PR XhmikosR#124

Co-Authored-By: Daniel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants