dffml
dffml copied to clipboard
service : dev : Enhance commit message linting
- See https://github.com/intel/dffml/pull/1076#issuecomment-864556863 for full details
- Related Issue #1040
- [x] 1. All commits starting with
testshouldn't contain anytest_in the rest of the parts- Implement a new mutation which is only triggered when the commit starts with
test
- Implement a new mutation which is only triggered when the commit starts with
- [x] 2. Substitutions are required for certain cases , where a word should translate to a path
- Add a substitution step which would replace such cases with their respective actual paths.
- [ ] 3. Checking for function/class names in files/folders
- Add a mutation which checks for a valid , file/directory path by recursively removing segments from the end of it until it finds a valid file/directory path , and then it searches for the removed segments in those files.
- for ex: In
util: net: cached_download(): Changed logging, the mutation should remove thecached_download()part and check forutil/netas a path with extensions mutation, and by this it will resolve todffml/util/net.py, and then we've to search in that file for the removed part , i.e.cached_download()in this file, similarly if it resolved to a directory then we'd need to search all the files in that directory. - This might sound complicated but it can be implemented easily as a
body_mutation, we'd need this category for other things as well curretly we have onlyprefix_mutationsandsuffix_mutationsonly , this body mutation should only be applied if all the removed parts are found in their respective file/directory paths.
- [ ] 4. Capitalization should be done for certain parts of the path
- Implement a body mutation to handle capitalisation of last and second last parts of the path.
- [ ] 5. Special keywords should be ignored
- A simple body mutation to filter these words can be implemented.
- [ ] 6. Investigate why this is failing and fix it, related to 1. above
- [ ] 7. Add support for "Merge branch
xintoy" type of commits. - [ ] 8. Add support for Reverted " < some valid commit > " type of commits.
- [ ] 9. Add rule that all that checks whether the first letter of every section of the commit is capitalised
- [ ] 10. Fix the bug introduced while implementing 1. above
There is some problem with commits related to tests, most probably related to point 1 above: Some failing examples:
tests: Renamed `accuracy` to `score`
model: vowpalWabbit: tests: Renamed `accuracy` to `score`
model: scikit: tests: Renamed `accuracy` to `score`
model: pytorch: tests: Renamed `accuracy` to `score`
We might want to go with https://commitizen-tools.github.io/commitizen/, let's discuss this today
Looks great !! I guess it might be the best way to do it as we're sort of re-inventing the wheel here, I will look into it and come up with a plan to port our lint commit CMD to use this. Thanks for sharing 🙂 .
We might want to go with https://commitizen-tools.github.io/commitizen/, let's discuss this today
We can also look into this one: https://github.com/wagoid/commitlint-github-action