Comments (2)
Hi,
yes, I actually considered this already, but didn't follow up on it yet, because it would require introducing some central settings that apply to multiple rules (and we simply don't have a place for that yet).
I guess what you'd need is to allow editing the prefix (default "TODO:
") and the suffix (default "(ABAP cleaner)
"), and the actual message would be put in the middle?
Changing this (or using different settings within a team) would mean, however, that ABAP cleaner might not be able to remove comments that were created with different settings (e.g. if a variable was unused but is now used).
Kind regards,
Jörg-Michael
from abap-cleaner.
Hi Jörg-Michael,
I guess what you'd need is to allow editing the prefix (default "TODO:") and the suffix (default "(ABAP cleaner)"), and the actual message would be put in the middle?
Yes, that would be the two options I would see as well.
Changing this (or using different settings within a team) would mean, however, that ABAP cleaner might not be able to remove comments that were created with different settings (e.g. if a variable was unused but is now used).
That's correct, but I assume that would already be the case for other formatting rules, if the setup is not consistent within a team.
Thus, I would see this issue as a team responsibility, to use a shared configuration and to ensure, that each member keeps the configuration up to date.
The only scenario I see, would be, that if unhandled comments are still present in the code base, at the time the configuration is being changed, it would not catch those and would add a duplicate comment.
I am not sure, if there is an elegant way to avoid this.
Possibilities I see:
- Check for single-line comments containing the main message, e.g. "
variable is assigned but never used
" and replace them.
Problem: if additional information has been added by the user in the same line, this would be lost. - Check for single-line comments containing the main message, e.g. "
variable is assigned but never used
". If it exists, skip adding a new comment (even if the format is incorrect). - Check for all known complete comments, e.g. all combinations of prefixes + message + suffixes (optionally with storing previously set pre-/suffixes) and replace them.
Should be safe?! - If a single-line comments containing the main message, e.g. "variable is assigned but never used" is found and does not match the current style: add additional suffix like "
(comment does not match configuration; remove comment and rerun ABAP cleaner to update it)
", if it is not present already. This could be made toggleable, with fallback to option 2.
My preference would be option 2 or 4 (with fallback to 2).
Cheers,
Benedikt
from abap-cleaner.
Related Issues (20)
- type structure in Function Moudle doesnt work HOT 1
- Indentation alignment for multi-line end-of-line comments? HOT 3
- Indentation Question / "Interactive local configuration" HOT 2
- Installed but it's not working!
- cx_assert does not exist HOT 2
- Failed referential integrity test "Remove needless CLEAR", despite syntactically correct HOT 4
- Feature request - multiple ABAP statements in one line to multiple lines HOT 2
- Feature request : Change APPEND to INSERT INTO TABLE HOT 7
- [BUG] Replace TRANSLATE for structure HOT 5
- Feature request: remove unnecessary CLEAR at the start of a method HOT 3
- Feature request: remove unnecessary [] to indicate tables HOT 1
- Add 'insert empty line before ANY statement' option to rule "Standardize empty lines within methods" HOT 1
- fyi: Referential Integrity Problem HOT 4
- String template is proposed for JSON string without any need HOT 4
- Feature Request: Point out NULL-reference HOT 1
- Packaging: Jar file contains resources twice HOT 4
- CORRESPONDING ... EXCEPT and LOOP AT ... GROUP BY indentation HOT 6
- variable is assigned but never used not working correctly HOT 3
- Align SELECT...FROM...JOIN HOT 2
- Delete unused variables HOT 2
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 abap-cleaner.