Comments (5)
I'm working on integrating pre-commit
right now but have found that pylint finds many violations on master. Perhaps most developers don't have the git hooks installed. pylint only seems to be run on changed files by SuperLinter (see the pre-merge.yml
workflow file). For pre-commit, it's easiest to run all hooks on all files in CI, though. So, for the first pass toward this, I'll integrate pre-commit
less pylint via SuperLinter. In other words, we'll consolidate our various lint entrypoints down to 2: pre-commit
and SuperLinter.
Also, we need to continue using the standalone commitlint
action in CI. While a hook exists for pre-commit
, it cannot easily run on commits already made. For this reason, we'll use the commitlint
hook for local commit linting and the action for commit linting in CI. At least they will share the same configuration (.commitlintrc.yml
).
from dgp.
SuperLinter has a ton of linters (see VALIDATE_*
environment variables), and DGP can use quite a few of them. By my estimate, DGP would use
VALIDATE_BASH
VALIDATE_GITHUB_ACTIONS
VALIDATE_GITLEAKS
VALIDATE_HTML
VALIDATE_JSON
VALIDATE_MARKDOWN
VALIDATE_NATURAL_LANGUAGE
VALIDATE_PROTOBUF
VALIDATE_PYTHON_PYLINT
VALIDATE_SHELL_SHELLFMT
VALIDATE_YAML
It's not clear to me which tools these options might use behind the scenes with the exception of ones where the tools are in the name. The most common one for us is pylint.
Moving away from pylint will require us to replace the above list with any linters we want to maintain coverage from and also to fix pylint issues so that we can run pylint on the whole codebase in CI via pre-commit.
from dgp.
I've found that there are quite a few latent pylint issues on master. I will need to fix these before replacing the tooling entrypoint with pre-commit
since we'll run on all files in CI.
from dgp.
After #122 , the only remaining hooks to move are markdownlint
and yamllint
. I will do this in separate work because there are existing linting errors on master. SuperLinter and our configuration of it suggests that we use these linters, but since they have not triggered errors in our CI, it's unclear to me whether we actually use them. Nonetheless, to maintain the current level of coverage, I will add these hooks and touch-up the files in violation.
Also, SuperLinter provides some hooks that we simply can't use (easily) in pre-commit, and so I am skipping them, with justifications.
actionlint
: This validates GitHub Action (YAML) files. To use this hook, our users have to manually install the tool (if outside of Docker), which is annoying. So, I skip this. We don't lose much by skipping it because we don't modify our Actions definitions frequently, and when we do, we'll get "free" validation when we push to GH. Of course, the iteration speed is very slow since we have to push to GH to trigger their parser.
Natural language validation: there is no existing pre-commit hook for this that I could find. I don't think this hook is terribly important. The most important part about natural language is that its meaning is generally understandable, and we enforce this in code review.
from dgp.
The last work toward this was merged today. DGP linting is done entirely through pre-commit
.
from dgp.
Related Issues (16)
- Pre-push hook prevents from pushing to fork of DGP repository. HOT 3
- `make build-proto` and `make test` fail after following Getting Start instructions HOT 1
- `build-docker` GH Actions workflow fails on master HOT 2
- Docs build tracks latest docs but shows old version HOT 5
- no 3d annotation in dataset HOT 1
- Parallel Domain GUDA dataset link broken HOT 2
- Pull fails after commiting inside docker container. HOT 12
- Semantic label for lidar HOT 2
- error in class name imported in visualize_dataset.py HOT 1
- DGP Proto: Which Ontology message to be used? HOT 1
- How to view and access 'depth' information HOT 2
- Missing 'key_line_2d' in `ONTOLOGY_REGISTRY` HOT 4
- Questions about DDAD_tiny dataset. HOT 1
- ERROR: Cannot install -r requirements.txt (line 2) and botocore==1.12.79 because these package versions have conflicting dependencies. HOT 3
- When to publish the DDAD15M datasets?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgp.