Skip to content

Conversation

@AyanSinhaMahapatra
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra commented Aug 24, 2022

  • Delete all .yml files for rules
  • Modify .RULE files to contain their data as YAML frontmatter
  • Merge these files preserving history

Reference: #3049
Signed-off-by: Ayan Sinha Mahapatra ayansmahapatra@gmail.com

@AyanSinhaMahapatra AyanSinhaMahapatra changed the title Introduce Rules with YAML frontmatter #3049 [WIP] Introduce Rules with YAML frontmatter #3049 Aug 24, 2022
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
This commit ends the process of merging .RULE and .yml files into
a single .RULE file which has YAML frontmatter storing the rule
metadata present in the .yml file previously.

This renaming and merging has been done to preserve line-history
for both the files.

Reference: #3049
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra
Copy link
Member Author

AyanSinhaMahapatra commented Aug 29, 2022

The merging of the .RULE and .yml files to .RULE files with YAML frontmatter has been done such that the line history is preserved.

This blogpost has been followed for the same.

Though note that this preserves only line history, i.e. entire history isn't tracked as the files are renamed (and git doesn't track history for renamed files see here). But you can still get the file history for these files by using git log --follow file_path

* Import and use functions/classes from frontmatter
* Copy and modify class to use saneyaml
* Copy and modify load/parse functions
* Add .ABOUT and LICENSE files.

Signed-off-by: AyanSinhaMahapatra <ayansmahapatra@gmail.com>
Rule classmethod from_files is renamed and modified to from_file
and now takes only the rule_file as argument.
Also modifies tests to use frontmatter.

Signed-off-by: AyanSinhaMahapatra <ayansmahapatra@gmail.com>
Modify test .RULE .yml file pairs to a single .RULE
file with YAML frontmatter.

Signed-off-by: AyanSinhaMahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra
Copy link
Member Author

@pombredanne btw, should we do the same for .LICENSE files?

@AyanSinhaMahapatra AyanSinhaMahapatra changed the title [WIP] Introduce Rules with YAML frontmatter #3049 Introduce Rules with YAML frontmatter #3049 Sep 7, 2022
@AyanSinhaMahapatra AyanSinhaMahapatra mentioned this pull request Sep 12, 2022
4 tasks
@pombredanne
Copy link
Member

This is already all in #3100 ... so closing.

@pombredanne pombredanne deleted the 3049-too-many-files branch October 28, 2022 16:08
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.

3 participants