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: Progressive linting #78

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

umar-muneer
Copy link

@umar-muneer umar-muneer commented Feb 7, 2020

This PR is dependent on #77

Right now after old and new stats have been collected, they are checked against only a single condition whether the warnings have been increased or not. This PR introduces the concept of guards. A guard is just a condition against which rule stats are checked. There are two guards provided by esplint right now.

  1. warningsIncreased Have warnings per file per rule increased than the previous calculated value
  2. warningsReducedBy Have warnings been reduced by the specified value. This is very important because developers could be enforced to remove warnings iteratively, in every sprint or a cycle.

By default, the warningsIncreased guard will run. Other guards can be specified through the command line by using the following option: --guards=warningsReducedBy. The following command will enable the guard.

./index.js example/index.js --guards=warningsReducedBy

A new parameter has been introduced in .esplintrc called reduceWarningsBy. This value will be provided in the numerical equivalent of percentages. For example, to enforce reduction by 10% the value specified in the config will be 0.1

@umar-muneer umar-muneer requested a review from hjylewis as a code owner February 7, 2020 05:00
@umar-muneer umar-muneer changed the title Progressive linting feat: Progressive linting Feb 7, 2020
@codecov
Copy link

codecov bot commented Feb 7, 2020

Codecov Report

Merging #78 into master will increase coverage by 0.02%.
The diff coverage is 99.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
+ Coverage   98.31%   98.34%   +0.02%     
==========================================
  Files          11       16       +5     
  Lines         357      422      +65     
  Branches       47       66      +19     
==========================================
+ Hits          351      415      +64     
- Misses          6        7       +1
Impacted Files Coverage Δ
lib/config.js 100% <100%> (ø) ⬆️
...g/fixtures/reduceWarningsBy-negative/.esplintrc.js 100% <100%> (ø)
__tests__/config/fixtures/.esplintrc.js 100% <100%> (ø)
lib/fileSet.js 100% <100%> (ø) ⬆️
lib/cli.js 94.02% <100%> (ø) ⬆️
lib/record.js 100% <100%> (ø) ⬆️
...ures/reduceWarningsBy-greater-than-1/.esplintrc.js 100% <100%> (ø)
...s__/config/fixtures/reduceWarningsBy/.esplintrc.js 100% <100%> (ø)
...config/fixtures/reduceWarningsBy-NAN/.esplintrc.js 100% <100%> (ø)
lib/engine.js 98.8% <98.8%> (-1.2%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04bb9d1...d0b2489. Read the comment docs.

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.

1 participant