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

feat: display tracking information about unused variables #125

Closed

Conversation

gentzeng
Copy link

@gentzeng gentzeng commented Jan 30, 2021

This is a feature and not a breaking change

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.

This feature heavily incorporates ideas from PR #124.
Co-Authored-By: Daniel 50356015+danny007in@users.noreply.github.com

This was referenced Jan 30, 2021
Copy link

@danny007in danny007in left a comment

Choose a reason for hiding this comment

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

did in non feasible way plz check #124

gentzeng referenced this pull request Jan 31, 2021
Breaking Change

Co-Authored-By: Georg Gentzen <60478031+gentzeng@users.noreply.github.com>
@gentzeng gentzeng force-pushed the additional-output-information branch from 137e4e1 to 300b76f Compare January 31, 2021 18:56
index.js Outdated
total: variables.length,
unusedOrigin: unusedVarsOrigin,
// for backwards compatibility of API
unused: unusedVarsOrigin.map(({ name }) => name)

Choose a reason for hiding this comment

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

unused should above only, plz do not make more complicated code

Copy link
Author

Choose a reason for hiding this comment

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

We need to keep the original 'unused' as an array containing only the variable names, as well as total being the amount of all variables, since I don't want to break the API of this function. Hence the additional return value for more information.

Copy link
Author

Choose a reason for hiding this comment

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

Furthermore, I think its convenient to see not only the amount of all variables, but of the unused as well
total

@gentzeng gentzeng force-pushed the additional-output-information branch 2 times, most recently from 4117c18 to 9fe401c Compare January 31, 2021 19:48
@danny007in
Copy link

@gentzeng rebase it

@gentzeng gentzeng force-pushed the additional-output-information branch 4 times, most recently from d83753e to 83e74ed Compare March 3, 2021 17:09
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 <50356015+danny007in@users.noreply.github.com>
@gentzeng gentzeng force-pushed the additional-output-information branch from 83e74ed to 4e2b3ee Compare March 3, 2021 17:22
@gentzeng
Copy link
Author

gentzeng commented Mar 3, 2021

Done

@@ -5,27 +5,32 @@ const Declaration = require('postcss/lib/declaration');
const Comment = require('postcss/lib/comment');
let fusvEnabled = true;

function parseNodes(nodes, variables, ignoreList) {
function parseNodes(nodes, variables, ignoreList, file = '') {

Choose a reason for hiding this comment

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

carefully adapt this
#134 (comment)
for file = '')

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