-
Notifications
You must be signed in to change notification settings - Fork 9
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
Eliminate global state, reducing technical debt #100
Conversation
This reverts commit f4dea0b.
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
=========================================
- Coverage 92.67% 0% -92.68%
=========================================
Files 28 28
Lines 846 815 -31
=========================================
- Hits 784 0 -784
- Misses 62 815 +753
Continue to review full report at Codecov.
|
This was a premature optimization
The name config implies that this is something supposed to be changed by the client. The idea of the defaults is that they can be substituted by user-supplied values. This allows the users to store multiple versions of the config and utilize them as they wish.
… get_ast_trees
Previously it ignored the files with names starting with '.'
This will be needed for some of the validators in the general group
We avoid redundant test runs with the "session" scope and remove the .git folder so it doesn't grow infinitely large.
Some of the validators, like has_no_bom, will try to analyze the contents of the .git folder, which shouldn't happen. This is a quick fix. The more long term solution would be to rewrite the validators to use ProjectFolder methods that ignore the files of inappropriate extensions.
The error occurred if some of the tests failed and the .git/index.lock file was not deleted.
This is probably due to the failing build in the master branch (https://docs.codecov.io/docs/error-reference#section-missing-base-commit):
|
The PR eliminates global state, making every parameterization possible by passing arguments to
validate
.Once merged, the will close #7, #9, #39, #40, #95, #99 and #102. It will also allow to work on #45, which was blocked by #9.
Changelog:
ParsedPyFile
class was introduced, combining all the info about file location as well as the parsedast
of the file.get_ast_trees
was removed and the method was was substituted with a simplerget_parsed_py_files
.get_parsed_py_files
LocalRepositoryInfo
was split into two classes:ProjectFolder
andLocalRepository
. This allows for validation of simple project folders without git repository in them.validate_repo
function is now simplyvalidate
.CodeValidator
is eliminated.config.py
is renamed todefaults.py
and is used as such: not a modifiable config, but immutable defaults that are used in case nothing is specified.directories_to_skip
parameter.has_no_directories_from_blacklist
now only inspects tracked directories, as it was intended.